From 175c53aed8a6aa6590b9388406fab359e0ae8f76 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 2 Jul 2020 10:56:02 +0100 Subject: [PATCH] libsysprof-capture: Use SYSPROF_PRINTF rather than G_GNUC_PRINTF It does the same thing for modern compilers. Signed-off-by: Philip Withnall Helps: #40 --- src/libsysprof-capture/sysprof-collector.h | 2 +- src/libsysprof-capture/sysprof-macros.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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