libsysprof-capture: Use SYSPROF_PRINTF rather than G_GNUC_PRINTF

It does the same thing for modern compilers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #40
This commit is contained in:
Philip Withnall
2020-07-02 10:56:02 +01:00
parent 9493fa2e03
commit 175c53aed8
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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