diff options
author | Olivier Hainque <hainque@adacore.com> | 2022-01-10 11:26:30 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@adacore.com> | 2022-01-16 09:22:14 +0000 |
commit | 00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0 (patch) | |
tree | 12882274e7c20f56e9aff45813435aec192fc567 /fixincludes/inclhack.def | |
parent | 1c2575586c47f56a2e75f734af42371579516f0c (diff) | |
download | gcc-00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0.zip gcc-00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0.tar.gz gcc-00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0.tar.bz2 |
Add VxWorks fixincludes hack, C99 FP classification
Arrange to provide missing defs for C99 FP classification functions
and constants queried by libstdc++ configure checks (C99 support for C++98)
2021-01-10 Olivier Hainque <hainque@adacore.com>
* inclhack.def (vxworks_math_h_fp_c99): New hack.
* tests/base/math.h: Update.
* fixincl.x: Regenerate.
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 4643678..2756478 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -5157,6 +5157,56 @@ fix = { test_text = "extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;"; }; + +/* + * Provide C99 FP classification support in VxWorks math.h if + * not already there. Note the strict expectation on #define without + * whitespaces in the bypass expression, which "works" for + * the system headers we have met and doesn't match test texts for + * other hacks, found in the test baseline. + */ +fix = { + hackname = vxworks_math_h_fp_c99; + mach = "*-*-vxworks*"; + files = math.h; + bypass = "#define[ \t]+FP_INFINITE"; + select = "#define HUGE_VAL[ \t]*_ARCH.*"; + c_fix = format; + c_fix_arg = << _EOArg_ + +%0 + +#if _C99 + +#define FP_INFINITE 1 +#define FP_NAN 2 +#define FP_NORMAL (-1) +#define FP_SUBNORMAL (-2) +#define FP_ZERO 0 + +#define fpclassify(x) \ + __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, \ + FP_SUBNORMAL, FP_ZERO, (x)) + +#define signbit(x) __builtin_signbit(x) +#define isfinite(x) __builtin_isfinite(x) +#define isnormal(x) __builtin_isnormal(x) +#define isnan(x) __builtin_isnan(x) +#define isinf(x) __builtin_isinf(x) + +#define isgreater(x, y) __builtin_isgreater((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal((x),(y)) +#define isless(x, y) __builtin_isless((x),(y)) +#define islessequal(x, y) __builtin_islessequal((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater((x),(y)) +#define isunordered(x, y) __builtin_isunordered((x),(y)) + +#endif /* _C99 */ + +_EOArg_; + + test_text = "#define HUGE_VAL _ARCH_HUGH_VAL"; +}; /* * mkdir's posix interface expects two arguments. While the RTP VxWorks |