mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Fix importc_compare test on Windows (#20922)
MSVC does not support C11 atomics, but it still provides a "stub" version of stdatomic.h, which aborts compilation with an #error directive when included. To avoid this error, explicitly set the C standard to C11 when invoking the C preprocessor on Windows, and check for the C11 macro __STDC_NO_ATOMICS__ before including stdatomic.h.
This commit is contained in:
parent
996acb0528
commit
5fc114165d
2 changed files with 5 additions and 1 deletions
|
@ -11,3 +11,7 @@ endif
|
|||
include ../common.mak
|
||||
|
||||
extra_dflags += -d
|
||||
|
||||
ifeq ($(OS),windows)
|
||||
extra_dflags += -P=/std:c11
|
||||
endif
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
#if __has_include(<sys/eventfd.h>)
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
#if __has_include(<stdatomic.h>)
|
||||
#if __has_include(<stdatomic.h>) && !defined(__STDC_NO_ATOMICS__)
|
||||
#include <stdatomic.h>
|
||||
#endif
|
||||
#if __has_include(<ifaddrs.h>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue