[Bf-blender-cvs] [3a72c9aa33c] master: Cleanup: use static_assert on MSVC versions that support it.

Ray Molenkamp noreply at git.blender.org
Fri May 31 16:12:24 CEST 2019


Commit: 3a72c9aa33c38b2005edd23834be2d2ecac050fc
Author: Ray Molenkamp
Date:   Fri May 31 08:12:21 2019 -0600
Branches: master
https://developer.blender.org/rB3a72c9aa33c38b2005edd23834be2d2ecac050fc

Cleanup: use static_assert on MSVC versions that support it.

This greatly improves the error message

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

M	source/blender/blenlib/BLI_assert.h

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

diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h
index 6942c87caec..7fb91656edb 100644
--- a/source/blender/blenlib/BLI_assert.h
+++ b/source/blender/blenlib/BLI_assert.h
@@ -89,7 +89,11 @@ extern "C" {
 #  define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
 #elif defined(_MSC_VER)
 /* Visual Studio */
-#  define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
+#  if _MSC_VER > 1910
+#    define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
+#  else
+#    define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
+#  endif
 #elif defined(__COVERITY__)
 /* Workaround error with coverity */
 #  define BLI_STATIC_ASSERT(a, msg)



More information about the Bf-blender-cvs mailing list