aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorOri Avtalion2016-07-23 14:04:56 +0300
committerOri Avtalion2016-07-23 16:18:51 +0300
commit4d120800fa63433e2fc2d76d69178431d53ba29e (patch)
tree4b7053a1d0d33be624e845149c90d127071e3bb1 /backends
parent2e4dd165e936dd0cce01df505993cbe49bb335d4 (diff)
downloadscummvm-rg350-4d120800fa63433e2fc2d76d69178431d53ba29e.tar.gz
scummvm-rg350-4d120800fa63433e2fc2d76d69178431d53ba29e.tar.bz2
scummvm-rg350-4d120800fa63433e2fc2d76d69178431d53ba29e.zip
ALL: Don't use 'defined' in macro definitions
This is undefined behavior and clang warns about it. See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-sys.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/backends/graphics/opengl/opengl-sys.h b/backends/graphics/opengl/opengl-sys.h
index 4495128f32..7b531cc140 100644
--- a/backends/graphics/opengl/opengl-sys.h
+++ b/backends/graphics/opengl/opengl-sys.h
@@ -48,9 +48,15 @@
// 0 - Force OpenGL context
// 1 - Force OpenGL ES context
// 2 - Force OpenGL ES 2.0 context
-#define USE_FORCED_GL (defined(USE_GLES_MODE) && USE_GLES_MODE == 0)
-#define USE_FORCED_GLES (defined(USE_GLES_MODE) && USE_GLES_MODE == 1)
-#define USE_FORCED_GLES2 (defined(USE_GLES_MODE) && USE_GLES_MODE == 2)
+#ifdef USE_GLES_MODE
+ #define USE_FORCED_GL (USE_GLES_MODE == 0)
+ #define USE_FORCED_GLES (USE_GLES_MODE == 1)
+ #define USE_FORCED_GLES2 (USE_GLES_MODE == 2)
+#else
+ #define USE_FORCED_GL 0
+ #define USE_FORCED_GLES 0
+ #define USE_FORCED_GLES2 0
+#endif
// On Tizen we include the toolchain's OpenGL file. This is something we
// actually want to avoid. However, since Tizen uses eglGetProcAddress which