[Bf-blender-cvs] [b6c6e6a] soc-2013-viewport_fx: Fixed some build errors that occur on MSVC 2014 when compiling WITH_GL_PROFILE_COMPAT.

Jason Wilkins noreply at git.blender.org
Fri Feb 14 19:09:24 CET 2014


Commit: b6c6e6a2c0d43d80f8730c043036c8e959a9e89a
Author: Jason Wilkins
Date:   Fri Feb 14 11:04:08 2014 -0600
https://developer.blender.org/rBb6c6e6a2c0d43d80f8730c043036c8e959a9e89a

Fixed some build errors that occur on MSVC 2014 when compiling WITH_GL_PROFILE_COMPAT.

(There are other errors that occur also in XCode, but I've fixed them in a separate commit already.)

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

M	intern/ghost/intern/GHOST_ContextWGL.cpp
M	source/blender/blenlib/BLI_math_base.h
M	source/blender/blenloader/intern/readfile.c
M	source/blender/gpu/intern/gpu_state_latch.c

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

diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index 600dcbc..4dab567 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -91,6 +91,7 @@ bool win32_chk(bool result, const char* file = NULL, int line = 0, const char* t
 				msg = "The device contexts specified are not compatible.  This can occur if the device contexts are managed by different drivers or possibly on different graphics adapters.\n";
 				break;
 
+#if WITH_GLEW_ES
 			case ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV:
 				msg = "The device context(s) and rendering context have non-matching affinity masks.\n";
 				break;
@@ -98,6 +99,7 @@ bool win32_chk(bool result, const char* file = NULL, int line = 0, const char* t
 			case ERROR_MISSING_AFFINITY_MASK_NV:
 				msg = "The rendering context does not have an affinity mask set.\n";
 				break;
+#endif
 
 			case ERROR_PROFILE_DOES_NOT_MATCH_DEVICE:
 				msg = "The specified profile is intended for a device of a different type than the specified device.\n";
@@ -316,7 +318,9 @@ GHOST_ContextWGL::GHOST_ContextWGL(
 	assert(m_hWnd);
 	assert(m_hDC);
 
+#if WITH_GLEW_ES
 	assert((m_contextProfileMask & ~(WGL_CONTEXT_CORE_PROFILE_BIT_ARB|WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB|WGL_CONTEXT_ES_PROFILE_BIT_EXT|WGL_CONTEXT_ES2_PROFILE_BIT_EXT)) == 0);
+#endif
 }
 
 
@@ -922,7 +926,10 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext(bool stereoVisual, GHO
 	if (WGLEW_ARB_create_context) {
 		int profileBitCore   = m_contextProfileMask & WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
 		int profileBitCompat = m_contextProfileMask & WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
+
+#if WITH_GLEW_ES
 		int profileBitES     = m_contextProfileMask & WGL_CONTEXT_ES_PROFILE_BIT_EXT;
+#endif
 
 		if (!WGLEW_ARB_create_context_profile && profileBitCore)
 			fprintf(stderr, "Warning! OpenGL core profile not available.\n");
@@ -930,11 +937,13 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext(bool stereoVisual, GHO
 		if (!WGLEW_ARB_create_context_profile && profileBitCompat)
 			fprintf(stderr, "Warning! OpenGL compatibility profile not available.\n");
 
+#if WITH_GLEW_ES
 		if (!WGLEW_EXT_create_context_es_profile && profileBitES && m_contextMajorVersion == 1)
 			fprintf(stderr, "Warning! OpenGL ES profile not available.\n");
 
 		if (!WGLEW_EXT_create_context_es2_profile && profileBitES && m_contextMajorVersion == 2)
 			fprintf(stderr, "Warning! OpenGL ES2 profile not available.\n");
+#endif
 
 		int profileMask = 0;
 
@@ -944,8 +953,10 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext(bool stereoVisual, GHO
 		if (WGLEW_ARB_create_context_profile && profileBitCompat)
 			profileMask |= profileBitCompat;
 
+#if WITH_GLEW_ES
 		if (WGLEW_EXT_create_context_es_profile && profileBitES)
 			profileMask |= profileBitES;
+#endif
 
 		std::vector<int> iAttributes;
 
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 4b71bab..6a23659 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -135,8 +135,10 @@
 #endif  /* C99 or POSIX.1-2001 */
 
 #ifdef WIN32
-#  ifndef FREE_WINDOWS
-#    define isnan(n) _isnan(n)
+#  if !defined(FREE_WINDOWS)
+#    if _MSC_VER && _MSC_VER < 1800
+#      define isnan(n) _isnan(n)
+#    endif
 #    define finite _finite
 #    define hypot _hypot
 #  endif
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b310abc..d04414f 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11293,7 +11293,7 @@ BlendFileData *blo_read_blendafterruntime(int file, const char *name, bli_off_t
 	BlendFileData *bfd = NULL;
 	FileData *fd = filedata_new();
 	fd->filedes = file;
-	fd->buffersize = actualsize; // XXX jwilkins: changine buffersize to bli_off_t is beyond my paygrade...
+	fd->buffersize = actualsize; // XXX jwilkins: changing buffersize to bli_off_t is beyond my paygrade...
 	fd->read = fd_read_from_file;
 	
 	/* needed for library_append and read_libraries */
diff --git a/source/blender/gpu/intern/gpu_state_latch.c b/source/blender/gpu/intern/gpu_state_latch.c
index c8d11e5..1bd3896 100644
--- a/source/blender/gpu/intern/gpu_state_latch.c
+++ b/source/blender/gpu/intern/gpu_state_latch.c
@@ -38,6 +38,10 @@
 #include "GPU_profile.h"
 #include "GPU_safety.h"
 
+/* external */
+#include "BLI_sys_types.h"
+#include "BLI_utildefines.h"
+
 /* standard */
 #include <string.h>




More information about the Bf-blender-cvs mailing list