[Scummvm-cvs-logs] scummvm master -> 68a15c10bec09edf37b4b357e3efbc055a402bdf

wjp wjp at usecode.org
Sat Aug 13 11:57:42 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4d120800fa ALL: Don't use 'defined' in macro definitions
68a15c10be Merge pull request #790 from salty-horse/clang_fixes


Commit: 4d120800fa63433e2fc2d76d69178431d53ba29e
    https://github.com/scummvm/scummvm/commit/4d120800fa63433e2fc2d76d69178431d53ba29e
Author: Ori Avtalion (ori at avtalion.name)
Date: 2016-07-23T16:18:51+03:00

Commit Message:
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>.

Changed paths:
    backends/graphics/opengl/opengl-sys.h
    base/plugins.h
    common/scummsys.h



diff --git a/backends/graphics/opengl/opengl-sys.h b/backends/graphics/opengl/opengl-sys.h
index 4495128..7b531cc 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 6037fc2..2793ff3 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 3513ee2..eb5ff24 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


Commit: 68a15c10bec09edf37b4b357e3efbc055a402bdf
    https://github.com/scummvm/scummvm/commit/68a15c10bec09edf37b4b357e3efbc055a402bdf
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-08-13T11:57:39+02:00

Commit Message:
Merge pull request #790 from salty-horse/clang_fixes

ALL: Don't use 'defined' in macro definitions

Changed paths:
    backends/graphics/opengl/opengl-sys.h
    base/plugins.h
    common/scummsys.h









More information about the Scummvm-git-logs mailing list