aboutsummaryrefslogtreecommitdiffstats
path: root/src/serd_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-04-19 16:49:25 +0200
committerDavid Robillard <d@drobilla.net>2019-04-20 13:04:50 +0200
commita12cbf64bc5860121e005a5237e63584501c7cb2 (patch)
tree42d2387b013fcab468ffd22ff97bf3f8e7839326 /src/serd_internal.h
parentaf31671c93c959f2750c92014b0159f8dc36459f (diff)
downloadserd-a12cbf64bc5860121e005a5237e63584501c7cb2.tar.gz
serd-a12cbf64bc5860121e005a5237e63584501c7cb2.tar.bz2
serd-a12cbf64bc5860121e005a5237e63584501c7cb2.zip
Fix incorrect print format arguments
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r--src/serd_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h
index dfb369b3..73c8113b 100644
--- a/src/serd_internal.h
+++ b/src/serd_internal.h
@@ -42,6 +42,12 @@
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
+#if defined(__GNUC__)
+# define SERD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1)))
+#else
+# define SERD_LOG_FUNC(fmt, arg1)
+#endif
+
static const uint8_t replacement_char[] = { 0xEF, 0xBF, 0xBD };
/* File and Buffer Utilities */
@@ -533,6 +539,7 @@ serd_error(SerdErrorSink error_sink, void* handle, const SerdError* e)
}
}
+SERD_LOG_FUNC(3, 4)
int
r_err(SerdReader* reader, SerdStatus st, const char* fmt, ...);