#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
-static void __itt_report_error(__itt_error_code code, ...)
-{
+static void __itt_report_error_impl(int code, ...) {
va_list args;
va_start(args, code);
if (__itt_ittapi_global.error_handler != NULL)
{
- __itt_error_handler_t* handler = (__itt_error_handler_t*)__itt_ittapi_global.error_handler;
- handler(code, args);
+ __itt_error_handler_t* handler = (__itt_error_handler_t*)(size_t)__itt_ittapi_global.error_handler;
+ handler((__itt_error_code)code, args);
}
#ifdef ITT_NOTIFY_EXT_REPORT
_N_(error_handler)(code, args);
va_end(args);
}
+//va_start cannot take enum (__itt_error_code) on clang, so it is necessary to transform it to int
+#define __itt_report_error(code, ...) \
+ __itt_report_error_impl((int)code,__VA_ARGS__)
+
+
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#pragma warning(pop)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */