diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-08-23 01:24:37 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-09-19 18:20:21 -0700 |
| commit | dc14434c0aed409a9152a05e4741623e0e99f32a (patch) | |
| tree | da59983d64d5a67b529738c24083c437af59c264 /lib/include/float.h | |
| parent | f69ff5e9b5267bd1e66ef0320b7fe6780858677d (diff) | |
| download | zig-dc14434c0aed409a9152a05e4741623e0e99f32a.tar.gz zig-dc14434c0aed409a9152a05e4741623e0e99f32a.zip | |
clang: Update compiler-provided C headers to Clang 19.
Diffstat (limited to 'lib/include/float.h')
| -rw-r--r-- | lib/include/float.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/include/float.h b/lib/include/float.h index 0e73bca0a2..e5c439a9d4 100644 --- a/lib/include/float.h +++ b/lib/include/float.h @@ -10,6 +10,10 @@ #ifndef __CLANG_FLOAT_H #define __CLANG_FLOAT_H +#if defined(__MVS__) && __has_include_next(<float.h>) +#include_next <float.h> +#else + /* If we're on MinGW, fall back to the system's float.h, which might have * additional definitions provided for Windows. * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx @@ -82,6 +86,18 @@ # undef DBL_HAS_SUBNORM # undef LDBL_HAS_SUBNORM # endif +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \ + !defined(__STRICT_ANSI__) +# undef FLT_NORM_MAX +# undef DBL_NORM_MAX +# undef LDBL_NORM_MAX +#endif +#endif + +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \ + !defined(__STRICT_ANSI__) +# undef INFINITY +# undef NAN #endif /* Characteristics of floating point types, C99 5.2.4.2.2 */ @@ -151,6 +167,17 @@ # define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__ #endif +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || \ + !defined(__STRICT_ANSI__) + /* C23 5.2.5.3.3p29-30 */ +# define INFINITY (__builtin_inff()) +# define NAN (__builtin_nanf("")) + /* C23 5.2.5.3.3p32 */ +# define FLT_NORM_MAX __FLT_NORM_MAX__ +# define DBL_NORM_MAX __DBL_NORM_MAX__ +# define LDBL_NORM_MAX __LDBL_NORM_MAX__ +#endif + #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__ # define FLT16_MANT_DIG __FLT16_MANT_DIG__ # define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__ @@ -165,4 +192,5 @@ # define FLT16_TRUE_MIN __FLT16_TRUE_MIN__ #endif /* __STDC_WANT_IEC_60559_TYPES_EXT__ */ +#endif /* __MVS__ */ #endif /* __CLANG_FLOAT_H */ |
