[Bf-blender-cvs] [bd7623f] soc-2014-viewport_context: replaced mx macros with stubs (like previous commits in this area it is meant to reduce the noise in the next big patch review)

Jason Wilkins noreply at git.blender.org
Thu Jul 31 16:16:36 CEST 2014


Commit: bd7623f1977c891bd02800c34d71429c7eb88de7
Author: Jason Wilkins
Date:   Thu Jul 31 09:16:19 2014 -0500
Branches: soc-2014-viewport_context
https://developer.blender.org/rBbd7623f1977c891bd02800c34d71429c7eb88de7

replaced mx macros with stubs (like previous commits in this area it is meant to reduce the noise in the next big patch review)

===================================================================

M	intern/glew-mx/glew-mx.h
M	intern/glew-mx/intern/glew-mx.c

===================================================================

diff --git a/intern/glew-mx/glew-mx.h b/intern/glew-mx/glew-mx.h
index 5a8ee5b..297149b 100644
--- a/intern/glew-mx/glew-mx.h
+++ b/intern/glew-mx/glew-mx.h
@@ -74,27 +74,16 @@ typedef struct MXContext {
 
 } MXContext;
 
+#ifdef WITH_GLEW_MX
 extern MXContext *_mx_context;
+#endif
 
 
-MXContext *mxCreateContext(void);
-
-
-#ifdef WITH_GLEW_MX
-
+MXContext *mxCreateContext     (void);
 MXContext *mxGetCurrentContext (void);
 void       mxMakeCurrentContext(MXContext *ctx);
 void       mxDestroyContext    (MXContext *ctx);
 
-#else
-
-/* don't use NULL here (mightn't be defined)*/
-#define mxGetCurrentContext()     ((MXContext *)0)
-#define mxMakeCurrentContext(ctx) ((void)ctx)
-#define mxDestroyContext(ctx)     ((void)ctx)
-
-#endif  /* WITH_GLEW_MX */
-
 
 GLenum glew_chk(GLenum error, const char *file, int line, const char *text);
 
diff --git a/intern/glew-mx/intern/glew-mx.c b/intern/glew-mx/intern/glew-mx.c
index 5913a04..54b9063 100644
--- a/intern/glew-mx/intern/glew-mx.c
+++ b/intern/glew-mx/intern/glew-mx.c
@@ -88,6 +88,11 @@ GLenum glew_chk(GLenum error, const char *file, int line, const char *text)
 #endif
 
 
+#ifdef WITH_GLEW_MX
+MXContext *_mx_context = NULL;
+#endif
+
+
 MXContext *mxCreateContext(void)
 {
 #if WITH_GLEW_MX
@@ -108,29 +113,34 @@ MXContext *mxCreateContext(void)
 }
 
 
-#ifdef WITH_GLEW_MX
-
-MXContext *_mx_context = NULL;
-
-
 MXContext *mxGetCurrentContext(void)
 {
+#if WITH_GLEW_MX
 	return _mx_context;
+#else
+	return NULL;
+#endif
 }
 
 
 void mxMakeCurrentContext(MXContext *ctx)
 {
+#if WITH_GLEW_MX
 	_mx_context = ctx;
+#else
+	(void)ctx;
+#endif
 }
 
 
 void mxDestroyContext(MXContext *ctx)
 {
+#if WITH_GLEW_MX
 	if (_mx_context == ctx)
 		_mx_context = NULL;
 
 	free(ctx);
+#else
+	(void)ctx;
+#endif
 }
-
-#endif  /* WITH_GLEW_MX */




More information about the Bf-blender-cvs mailing list