diff --git a/src/libsysprof-capture/sysprof-collector.h b/src/libsysprof-capture/sysprof-collector.h index f59ca921..b91a5a7c 100644 --- a/src/libsysprof-capture/sysprof-collector.h +++ b/src/libsysprof-capture/sysprof-collector.h @@ -85,6 +85,6 @@ SYSPROF_AVAILABLE_IN_3_38 void sysprof_collector_log_printf (int severity, const char *domain, const char *format, - ...) G_GNUC_PRINTF (3, 4); + ...) SYSPROF_PRINTF (3, 4); SYSPROF_END_DECLS diff --git a/src/libsysprof-capture/sysprof-macros.h b/src/libsysprof-capture/sysprof-macros.h index a7bcc04f..1faa0022 100644 --- a/src/libsysprof-capture/sysprof-macros.h +++ b/src/libsysprof-capture/sysprof-macros.h @@ -80,3 +80,9 @@ #define SYSPROF_LIKELY(expr) (expr) #define SYSPROF_UNLIKELY(expr) (expr) #endif + +#if defined(__GNUC__) +#define SYSPROF_PRINTF(format_idx, arg_idx) __attribute__((format(printf, format_idx, arg_idx))) +#else +#define SYSPROF_PRINTF(format_idx, arg_idx) +#endif