From e3dfe29110fd85ea9f20259a502e40133829067e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 30 May 2019 17:03:08 +0200 Subject: 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. --- source/blender/blenlib/BLI_assert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib') 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); -- cgit v1.2.3