diff options
author | Willem Jan Palenstijn | 2016-08-13 11:57:39 +0200 |
---|---|---|
committer | GitHub | 2016-08-13 11:57:39 +0200 |
commit | 68a15c10bec09edf37b4b357e3efbc055a402bdf (patch) | |
tree | 69d208325eeaa33a890ee66d27607e7ecb778789 | |
parent | 6a9923ec07d019cbbf8c35e36030391dac256e79 (diff) | |
parent | 4d120800fa63433e2fc2d76d69178431d53ba29e (diff) | |
download | scummvm-rg350-68a15c10bec09edf37b4b357e3efbc055a402bdf.tar.gz scummvm-rg350-68a15c10bec09edf37b4b357e3efbc055a402bdf.tar.bz2 scummvm-rg350-68a15c10bec09edf37b4b357e3efbc055a402bdf.zip |
Merge pull request #790 from salty-horse/clang_fixes
ALL: Don't use 'defined' in macro definitions
-rw-r--r-- | backends/graphics/opengl/opengl-sys.h | 12 | ||||
-rw-r--r-- | base/plugins.h | 8 | ||||
-rw-r--r-- | common/scummsys.h | 6 |
3 files changed, 20 insertions, 6 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 diff --git a/base/plugins.h b/base/plugins.h index 6037fc2d71..2793ff3ffd 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -79,8 +79,12 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX]; #define PLUGIN_ENABLED_STATIC(ID) \ (ENABLE_##ID && !PLUGIN_ENABLED_DYNAMIC(ID)) -#define PLUGIN_ENABLED_DYNAMIC(ID) \ - (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES)) +#ifdef DYNAMIC_MODULES + #define PLUGIN_ENABLED_DYNAMIC(ID) \ + (ENABLE_##ID && (ENABLE_##ID == DYNAMIC_PLUGIN)) +#else + #define PLUGIN_ENABLED_DYNAMIC(ID) 0 +#endif // see comments in backends/plugins/elf/elf-provider.cpp #if defined(USE_ELF_LOADER) && defined(ELF_LOADER_CXA_ATEXIT) diff --git a/common/scummsys.h b/common/scummsys.h index 5e1069fb46..959c67a404 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -29,7 +29,11 @@ // This is a convenience macro to test whether the compiler used is a GCC // version, which is at least major.minor. -#define GCC_ATLEAST(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) +#ifdef __GNUC__ + #define GCC_ATLEAST(major, minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) +#else + #define GCC_ATLEAST(major, minor) 0 +#endif #if defined(_WIN32_WCE) && _WIN32_WCE < 300 #define NONSTANDARD_PORT |