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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-30 18:03:08 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-31 11:49:36 +0300
commite3dfe29110fd85ea9f20259a502e40133829067e (patch)
treed46436e3fa41edb850fb1fda1e342ec2ff382b55 /source/blender/blenlib
parent26d4a2a5169472369829905a960786390bc09c0e (diff)
Fix T65334: use _Static_assert on clang as well, to avoid macOS build error
Still needs a proper solution for older compilers with custom static assert. macro that can conflict when there is an assert on the same line in multiple files.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_assert.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h
index 3d3c84d6370..366ed86c022 100644
--- a/source/blender/blenlib/BLI_assert.h
+++ b/source/blender/blenlib/BLI_assert.h
@@ -87,7 +87,8 @@ extern "C" {
/* C++ can't use _Static_assert, expects static_assert() but c++0x only,
* Coverity also errors out. */
#if (!defined(__cplusplus)) && (!defined(__COVERITY__)) && \
- (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) /* gcc4.6+ only */
+ ((defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) || \
+ (defined(__clang__) && __has_feature(c_static_assert))) /* GCC 4.6+ and clang */
# define BLI_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg);
#elif defined(_MSC_VER)
# define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);