Skip to content

Commit 22cac91

Browse files
authored
Include <stdnoreturn.h> last (#1330)
Starting with the Windows SDK 10.0.26100.3916, inclusion of `<stdnoreturn.h>` clashes with some of the definitions in other ucrt headers. Move `<stdnoreturn.h>` to be last to work around this issue.
1 parent 226ba0a commit 22cac91

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/_FoundationCShims/include/_CStdlib.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@
101101
#include <stdlib.h>
102102
#endif
103103

104-
#if __has_include(<stdnoreturn.h>)
105-
#include <stdnoreturn.h>
106-
#endif
107-
108104
#if __has_include(<string.h>)
109105
#include <string.h>
110106
#endif
@@ -164,5 +160,10 @@
164160

165161
#endif
166162

163+
// Must be last to avoid conflicts with other headers on Windows.
164+
#if __has_include(<stdnoreturn.h>)
165+
#include <stdnoreturn.h>
166+
#endif
167+
167168
#endif // FOUNDATION_CSTDLIB
168169

0 commit comments

Comments
 (0)