Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 133d190

Browse files
authored
Fix build with xcode 9.3 (#28768)
The c_static_assert definition is causing build problems on OSX. The compiler complains about the typedef we use to implement the c_static_assert: declaration shadows a typedef in the global scope [-Werror,-Wshadow] This is due to multiple static asserts To fix it, I have modified the c_static_assert to use _Static_assert C feature that's available in clang.
1 parent d0c47fa commit 133d190

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Native/Unix/Common/pal_compiler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#ifdef static_assert
1717
#define c_static_assert(e) static_assert((e),"")
18+
#elif defined(__has_extension) && __has_extension(c_static_assert)
19+
#define c_static_assert(e) _Static_assert((e), "")
1820
#else
1921
#define c_static_assert(e) typedef char __c_static_assert__[(e)?1:-1]
2022
#endif

0 commit comments

Comments
 (0)