[cogl/wip/cogl-1.14: 111/177] Don't use #if with defines that are either defined or not



commit 693fe177b05b9e65f9225d019dc8fdd2283d32de
Author: Damien Lespiau <damien lespiau intel com>
Date:   Sat Dec 29 02:00:00 2012 +0000

    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 fe844e1..850cd63 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 <wayland-server.h>
 #endif
 
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index 11f0ec3..ec675ca 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 6e02ad7..9f6bfff 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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]