openbsd-ports/emulators/qemu/patches/patch-gnu-c99-math_h

28 lines
789 B
Plaintext

$OpenBSD: patch-gnu-c99-math_h,v 1.3 2006/06/08 14:33:38 todd Exp $
--- gnu-c99-math.h.orig Fri May 5 22:23:24 2006
+++ gnu-c99-math.h Thu May 11 20:24:00 2006
@@ -0,0 +1,23 @@
+#if (defined(__sun__) || defined(__OpenBSD__)) && defined(__GNUC__)
+
+/*
+ * C99 7.12.3 classification macros
+ * and
+ * C99 7.12.14 comparison macros
+ *
+ * ... do not work on Solaris 10 using GNU CC 3.4.x.
+ * Try to workaround the missing / broken C99 math macros.
+ */
+#include <ieeefp.h>
+#include <float.h>
+
+#define isnormal(x) (fabs(x) < DBL_EPSILON && !isnan(x) && !isinf(x))
+
+#define isgreater(x, y) ((x) > (y))
+#define isgreaterequal(x, y) ((x) >= (y))
+#define isless(x, y) ((x) < (y))
+#define islessequal(x, y) ((x) <= (y))
+
+#define isunordered(x,y) (isnan(x) || isnan(y))
+
+#endif