aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Packard2014-01-12 12:32:57 -0600
committerKeith Packard2014-01-13 12:13:42 -0600
commitcb4bc8ead63cb213a26bcc8d14b2b44d9fb967da (patch)
treea0bf658d642f42a2df547f9a7c423964f8f6999b /xf86drm.h
parent8279c8fb498785ea2700c6cc4a3456d7e1134665 (diff)
downloadexternal-libdrm-cb4bc8ead63cb213a26bcc8d14b2b44d9fb967da.tar.gz
external-libdrm-cb4bc8ead63cb213a26bcc8d14b2b44d9fb967da.tar.xz
external-libdrm-cb4bc8ead63cb213a26bcc8d14b2b44d9fb967da.zip
Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))
the drmServerInfo member, debug_print, takes a printf format string and varargs list. Tell the compiler about it. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/xf86drm.h b/xf86drm.h
index 1e763a3d..5e170f86 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -92,8 +92,14 @@ extern "C" {
92typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ 92typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */
93typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ 93typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */
94 94
95#if (__GNUC__ >= 3)
96#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
97#else
98#define DRM_PRINTFLIKE(f, a)
99#endif
100
95typedef struct _drmServerInfo { 101typedef struct _drmServerInfo {
96 int (*debug_print)(const char *format, va_list ap); 102 int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0);
97 int (*load_module)(const char *name); 103 int (*load_module)(const char *name);
98 void (*get_perms)(gid_t *, mode_t *); 104 void (*get_perms)(gid_t *, mode_t *);
99} drmServerInfo, *drmServerInfoPtr; 105} drmServerInfo, *drmServerInfoPtr;