diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-01 10:49:26 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-01 10:49:26 +0900 |
| commit | 385d2e3722c22e788230c1cfba679356fbdd2d0a (patch) | |
| tree | 421756c2661e82420fbfa61554e6268ee1b020d3 | |
| parent | 36031312f14077ca659feb30be371c9d627d1703 (diff) | |
| download | ducc-385d2e3722c22e788230c1cfba679356fbdd2d0a.tar.gz ducc-385d2e3722c22e788230c1cfba679356fbdd2d0a.tar.zst ducc-385d2e3722c22e788230c1cfba679356fbdd2d0a.zip | |
feat: define float-related macros for GCC compatibility
| -rw-r--r-- | src/preprocess.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/preprocess.c b/src/preprocess.c index fe24f99..9776b5a 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -166,6 +166,17 @@ static void add_predefined_macros(MacroArray* macros) { define_macro_to_number(macros, "__WCHAR_MIN__", __WCHAR_MIN__); define_macro_to_number(macros, "__WINT_MIN__", __WINT_MIN__); define_macro_to_number(macros, "__SIG_ATOMIC_MIN__", __SIG_ATOMIC_MIN__); + + // GCC's predefined macros not listed in Common Predefined Macros page. + define_macro_to_number(macros, "__DBL_DIG__", __DBL_DIG__); + define_macro_to_number(macros, "__DBL_MANT_DIG__", __DBL_MANT_DIG__); + define_macro_to_number(macros, "__DBL_MAX_10_EXP__", __DBL_MAX_10_EXP__); + define_macro_to_number(macros, "__FLT_DIG__", __FLT_DIG__); + define_macro_to_number(macros, "__FLT_MANT_DIG__", __FLT_MANT_DIG__); + define_macro_to_number(macros, "__FLT_MAX_10_EXP__", __FLT_MAX_10_EXP__); + define_macro_to_number(macros, "__LDBL_DIG__", __LDBL_DIG__); + define_macro_to_number(macros, "__LDBL_MANT_DIG__", __LDBL_MANT_DIG__); + define_macro_to_number(macros, "__LDBL_MAX_10_EXP__", __LDBL_MAX_10_EXP__); } // Accept "FOO" or "FOO=value" |
