Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-25 08:44:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-25 08:44:46 +0400
commit9e6d27bbf0afed29f3b31800d75c17ee68472a9c (patch)
tree84082a76c5c017b1c678d4af50f808ee1d277189 /source/blender/blenlib/BLI_utildefines.h
parent69fa77d279f602641c965919a3071713cb4addb7 (diff)
add BLI_STATIC_ASSERT macro.
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r--source/blender/blenlib/BLI_utildefines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 801cff089d7..22312a52e87 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -348,6 +348,13 @@
# define BLI_assert(a) (void)0
#endif
+#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */
+# define BLI_STATIC_ASSERT(a, msg) _Static_assert(a, msg);
+#else
+ /* TODO msvc, clang */
+# define BLI_STATIC_ASSERT(a, msg) (void)0
+#endif
+
/* hints for branch pradiction, only use in code that runs a _lot_ where */
#ifdef __GNUC__
# define LIKELY(x) __builtin_expect(!!(x), 1)