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.
This commit is contained in:
Brecht Van Lommel
2019-05-30 17:03:08 +02:00
parent 26d4a2a516
commit e3dfe29110

View File

@@ -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);