diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-03 14:18:45 -0700 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-03 14:18:45 -0700 |
| commit | 00703ad2bc9a69f068b0eee3fdcea7432b130bef (patch) | |
| tree | ae7509c3c426ffe419d2b119dd80149434e3b350 /src | |
| parent | protocol: Document how clients are supposed to get the xkb keycode (diff) | |
| download | wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar.gz wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar.bz2 wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar.lz wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar.xz wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.tar.zst wayland-00703ad2bc9a69f068b0eee3fdcea7432b130bef.zip | |
Add WL_PRINTF attribute and annotate wl_log_func_t
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-util.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wayland-util.h b/src/wayland-util.h index 57764d9..fd32826 100644 --- a/src/wayland-util.h +++ b/src/wayland-util.h @@ -51,6 +51,13 @@ extern "C" { #define WL_DEPRECATED #endif +/* Printf annotation */ +#if defined(__GNUC__) && __GNUC__ >= 4 +#define WL_PRINTF(x, y) __attribute__((__format__(__printf__, x, y))) +#else +#define WL_PRINTF(x, y) +#endif + struct wl_message { const char *name; const char *signature; @@ -276,7 +283,7 @@ typedef int (*wl_dispatcher_func_t)(const void *, void *, uint32_t, const struct wl_message *, union wl_argument *); -typedef void (*wl_log_func_t)(const char *, va_list); +typedef void (*wl_log_func_t)(const char *, va_list) WL_PRINTF(1, 0); #ifdef __cplusplus } |
