From b8d9bbed1aa98a82ebdba255230235534e8ea55b Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Sat, 29 Dec 2012 02:00:00 +0000 Subject: [PATCH] Don't use #if with defines that are either defined or not COGL_HAS_* and COGL_ENABLE_DEBUG are either defined in config.h or not. So let's test against this, not against their truth value, this allow us to use -Wundef to catch undefined macros in preprocessor directives. (cherry picked from commit 73b62832f24711073b0876a6c0f5c61727842c1c) --- cogl/cogl-display-private.h | 2 +- cogl/cogl-renderer.c | 4 ++-- cogl/cogl-util.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cogl/cogl-display-private.h b/cogl/cogl-display-private.h index fe844e160..850cd631a 100644 --- a/cogl/cogl-display-private.h +++ b/cogl/cogl-display-private.h @@ -30,7 +30,7 @@ #include "cogl-renderer.h" #include "cogl-onscreen-template.h" #include "cogl-internal.h" -#if COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT +#ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT #include #endif diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c index 11f0ec392..ec675cac3 100644 --- a/cogl/cogl-renderer.c +++ b/cogl/cogl-renderer.c @@ -73,7 +73,7 @@ #include "cogl-winsys-sdl-private.h" #endif -#if COGL_HAS_XLIB_SUPPORT +#ifdef COGL_HAS_XLIB_SUPPORT #include "cogl-xlib-renderer.h" #endif @@ -188,7 +188,7 @@ cogl_renderer_new (void) return _cogl_renderer_object_new (renderer); } -#if COGL_HAS_XLIB_SUPPORT +#ifdef COGL_HAS_XLIB_SUPPORT void cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer, Display *xdisplay) diff --git a/cogl/cogl-util.h b/cogl/cogl-util.h index 6e02ad7dd..9f6bfffba 100644 --- a/cogl/cogl-util.h +++ b/cogl/cogl-util.h @@ -194,7 +194,7 @@ _cogl_util_popcountl (unsigned long num) #define _COGL_RETURN_IF_FAIL(EXPR) g_return_if_fail(EXPR) #define _COGL_RETURN_VAL_IF_FAIL(EXPR, VAL) g_return_val_if_fail(EXPR, VAL) #else -#if COGL_ENABLE_DEBUG +#ifdef COGL_ENABLE_DEBUG #define _COGL_RETURN_START do { #define _COGL_RETURN_END } while (0) #else /* COGL_ENABLE_DEBUG */