From 920fb7ea26b1c00a6c023e18f184a9076f89e8ce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 21 Jul 2020 20:20:07 +0200 Subject: Add format function annotations --- src/jalv_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 3bfc102..0932460 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -58,6 +58,12 @@ # define REALTIME #endif +#ifdef __GNUC__ +# define JALV_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) +#else +# define JALV_LOG_FUNC(fmt, arg1) +#endif + #ifdef __cplusplus extern "C" { #endif @@ -526,11 +532,13 @@ jalv_strjoin(const char* a, const char* b) return out; } +JALV_LOG_FUNC(3, 4) int jalv_printf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...); +JALV_LOG_FUNC(3, 0) int jalv_vprintf(LV2_Log_Handle handle, LV2_URID type, -- cgit v1.2.1