summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-05-15 09:54:10 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-06-05 15:15:12 +1000
commitf5c4de024db606d67daedc37402ebd62ced7ca5d (patch)
tree9b111f8693923774bc535efc19f381fc32a70d9a
parent25507127bd471ed05a00596c2ac4f887d6f7b70f (diff)
downloadlibevdev-f5c4de024db606d67daedc37402ebd62ced7ca5d.tar.gz
Mark the log functions with the printf format attribute
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--doc/libevdev.doxygen.in6
-rw-r--r--libevdev/libevdev-int.h3
-rw-r--r--libevdev/libevdev.h5
3 files changed, 8 insertions, 6 deletions
diff --git a/doc/libevdev.doxygen.in b/doc/libevdev.doxygen.in
index b46a4d7..853c47d 100644
--- a/doc/libevdev.doxygen.in
+++ b/doc/libevdev.doxygen.in
@@ -1537,13 +1537,13 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
-MACRO_EXPANSION = NO
+MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
-EXPAND_ONLY_PREDEF = NO
+EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# pointed to by INCLUDE_PATH will be searched when a #include is found.
@@ -1571,7 +1571,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED =
+PREDEFINED = LIBEVDEV_ATTRIBUTE_PRINTF(f,a)=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
index 98c75ce..f587e76 100644
--- a/libevdev/libevdev-int.h
+++ b/libevdev/libevdev-int.h
@@ -36,7 +36,6 @@
#define ABS_MT_MAX ABS_MT_TOOL_Y
#define ABS_MT_CNT (ABS_MT_MAX - ABS_MT_MIN + 1)
#define LIBEVDEV_EXPORT __attribute__((visibility("default")))
-#define LIBEVDEV_PRINTF(_format, _args) __attribute__ ((format (printf, _format, _args)))
#define ALIAS(_to) __attribute__((alias(#_to)))
/**
@@ -131,7 +130,7 @@ extern void
log_msg(enum libevdev_log_priority priority,
void *data,
const char *file, int line, const char *func,
- const char *format, ...) LIBEVDEV_PRINTF(6, 7);
+ const char *format, ...) LIBEVDEV_ATTRIBUTE_PRINTF(6, 7);
/**
* @return a pointer to the next element in the queue, or NULL if the queue
diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
index a74d24c..6c03cce 100644
--- a/libevdev/libevdev.h
+++ b/libevdev/libevdev.h
@@ -30,6 +30,8 @@ extern "C" {
#include <linux/input.h>
#include <stdarg.h>
+#define LIBEVDEV_ATTRIBUTE_PRINTF(_format, _args) __attribute__ ((format (printf, _format, _args)))
+
/**
* @mainpage
*
@@ -790,7 +792,8 @@ typedef void (*libevdev_log_func_t)(enum libevdev_log_priority priority,
void *data,
const char *file, int line,
const char *func,
- const char *format, va_list args);
+ const char *format, va_list args)
+ LIBEVDEV_ATTRIBUTE_PRINTF(6, 0);
/**
* @ingroup init