[COMMITTED] hpux: New include hack to fix declarations of _DINFINITY, _SINFINITY and _SQNAN
Commit Message
The declarations of _DINFINITY, _SINFINITY and _SQNAN need to be constant
expressions.
Committed to trunk.
Dave
---
2022-02-27 John David Anglin <danglin@gcc.gnu.org>
fixincludes/ChangeLog:
* inclhack.def (hpux_math_constexpr): New hack.
* fixincl.x: Regenerate.
* tests/base/math.h: Update.
@@ -2282,6 +2282,24 @@ fix = {
" }\n";
};
+/*
+ * This hack fixes the declarations of _DINFINITY, _SINFINITY and _SQNAN.
+ */
+fix = {
+ hackname = hpux_math_constexpr;
+ mach = "*-hp-hpux11*";
+ files = math.h;
+ sed = "s@^[ \t]*extern[ \t]*const[ \t]*double[ \t]*_DINFINITY;"
+ "[ \t]*$@# define _DINFINITY (__builtin_inf ())@";
+ sed = "s@^[ \t]*extern[ \t]*const[ \t]*float[ \t]*_SINFINITY;"
+ "[ \t]*$@# define _SINFINITY (__builtin_inff ())@";
+ sed = "s@^[ \t]*extern[ \t]*const[ \t]*float[ \t]*_SQNAN;"
+ "[ \t]*$@# define _SQNAN (__builtin_nanf (\\\"\\\"))@";
+ test_text = " extern const double _DINFINITY;\n"
+ " extern const float _SINFINITY;\n"
+ " extern const float _SQNAN;";
+};
+
/*
* Fix hpux 10.X missing ctype declarations 1
*/
@@ -57,6 +57,13 @@
#endif /* HPUX11_CPP_POW_INLINE_CHECK */
+#if defined( HPUX_MATH_CONSTEXPR_CHECK )
+# define _DINFINITY (__builtin_inf ())
+# define _SINFINITY (__builtin_inff ())
+# define _SQNAN (__builtin_nanf (""))
+#endif /* HPUX_MATH_CONSTEXPR_CHECK */
+
+
#if defined( HPUX11_FABSF_CHECK )
#ifdef _PA_RISC
#ifndef __cplusplus