summaryrefslogtreecommitdiff
path: root/fixincludes/tests
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2022-01-10 11:26:30 +0000
committerOlivier Hainque <hainque@adacore.com>2022-01-16 09:22:14 +0000
commit00cc412660fe4d64c0b04da9ae20b1ad6ef92bb0 (patch)
tree12882274e7c20f56e9aff45813435aec192fc567 /fixincludes/tests
parent1c2575586c47f56a2e75f734af42371579516f0c (diff)
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/tests')
-rw-r--r--fixincludes/tests/base/math.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/fixincludes/tests/base/math.h b/fixincludes/tests/base/math.h
index 58f695f9adf..7525fd82ecf 100644
--- a/fixincludes/tests/base/math.h
+++ b/fixincludes/tests/base/math.h
@@ -104,6 +104,40 @@ extern int class();
int foo;
#endif
#endif /* STRICT_ANSI_NOT_CTD_CHECK */
+
+
+#if defined( VXWORKS_MATH_H_FP_C99_CHECK )
+
+#define HUGE_VAL _ARCH_HUGH_VAL
+
+#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 */
+
+#endif /* VXWORKS_MATH_H_FP_C99_CHECK */
#ifdef __cplusplus
#undef exception
#endif