| ... | ... | @@ -68,9 +68,16 @@ |
| 68 | 68 | #define zig_x86 |
| 69 | 69 | #endif |
| 70 | 70 | |
| 71 | #if defined(__has_include) |
| 72 | #define zig_has_include(include) __has_include(include) |
| 73 | #else |
| 74 | #define zig_has_include(include) 0 |
| 75 | #endif |
| 76 | |
| 71 | 77 | #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ |
| 72 | 78 | #define __STDC_WANT_IEC_60559_TYPES_EXT__ |
| 73 | 79 | #endif |
| 80 | |
| 74 | 81 | #include <float.h> |
| 75 | 82 | #include <limits.h> |
| 76 | 83 | #include <stdarg.h> |
| ... | ... | @@ -82,7 +89,7 @@ |
| 82 | 89 | |
| 83 | 90 | #if __STDC_VERSION__ >= 202311L |
| 84 | 91 | /* bool, true, and false are provided by the language. */ |
| 85 | | #elif __STDC_VERSION__ >= 199901L |
| 92 | #elif __STDC_VERSION__ >= 199901L || zig_has_include(<stdbool.h>) |
| 86 | 93 | #include <stdbool.h> |
| 87 | 94 | #else |
| 88 | 95 | typedef char bool; |
| ... | ... | @@ -428,7 +435,7 @@ zig_extern void *memset (void *, int, size_t); |
| 428 | 435 | |
| 429 | 436 | /* ===================== 8/16/32/64-bit Integer Support ===================== */ |
| 430 | 437 | |
| 431 | | #if __STDC_VERSION__ >= 199901L || defined(zig_msvc) |
| 438 | #if __STDC_VERSION__ >= 199901L || defined(zig_msvc) || zig_has_include(<stdint.h>) |
| 432 | 439 | #include <stdint.h> |
| 433 | 440 | #else |
| 434 | 441 | |
| ... | ... | @@ -3655,7 +3662,7 @@ zig_float_builtins(64) |
| 3655 | 3662 | res = zig_atomicrmw_expected; \ |
| 3656 | 3663 | } while (0) |
| 3657 | 3664 | |
| 3658 | | #if __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__) |
| 3665 | #if (__STDC_VERSION__ >= 201112L || (zig_has_include(<stdatomic.h>) && !defined(zig_msvc))) && !defined(__STDC_NO_ATOMICS__) |
| 3659 | 3666 | #include <stdatomic.h> |
| 3660 | 3667 | typedef enum memory_order zig_memory_order; |
| 3661 | 3668 | #define zig_memory_order_relaxed memory_order_relaxed |