diff options
author | Eric Anholt <[email protected]> | 2014-01-23 11:03:53 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-01-27 09:37:29 -0800 |
commit | 4a8da40fc089d465b72ecee89e24cd92e6714669 (patch) | |
tree | 983c52083b7803ff60ccb70b7377c0e5c154fac1 /src/glx/dri_common.h | |
parent | 7bd95ec437a5b1052fa17780a9d66677ec1fdc35 (diff) |
dri: Fix the logger error message handling.
Since the loader changes, there has been a compiler warning that the
prototype didn't match. It turns out that if a loader error message was
ever thrown, you'd segfault because of trying to use the warning level as
a format string.
Reviewed-by: Keith Packard <[email protected]>
Tested-by: Keith Packard <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glx/dri_common.h')
-rw-r--r-- | src/glx/dri_common.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/glx/dri_common.h b/src/glx/dri_common.h index 4fe0d3faf98..425d89f9224 100644 --- a/src/glx/dri_common.h +++ b/src/glx/dri_common.h @@ -39,6 +39,12 @@ #include <GL/internal/dri_interface.h> #include <stdbool.h> +#if (__GNUC__ >= 3) +#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) +#else +#define PRINTFLIKE(f, a) +#endif + typedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate; struct __GLXDRIconfigPrivateRec @@ -61,10 +67,10 @@ driReleaseDrawables(struct glx_context *gc); extern const __DRIsystemTimeExtension systemTimeExtension; -extern void InfoMessageF(const char *f, ...); +extern void dri_message(int level, const char *f, ...) PRINTFLIKE(2, 3); +extern void InfoMessageF(const char *f, ...); extern void ErrorMessageF(const char *f, ...); - extern void CriticalErrorMessageF(const char *f, ...); extern void *driOpenDriver(const char *driverName); |