openbsd-ports/emulators/qemu/patches/patch-gnu-c99-math_h
todd 5ba4e4fd59 update to 0.9.0, thanks to all who gave feedback
see http://qemu.org/changelog.html for details
new in OpenBSD, support for raw block devices
2007-05-01 12:55:13 +00:00

28 lines
789 B
Plaintext

$OpenBSD: patch-gnu-c99-math_h,v 1.4 2007/05/01 12:55:14 todd Exp $
--- gnu-c99-math.h.orig Sat Mar 10 16:39:40 2007
+++ gnu-c99-math.h Sat Mar 10 16:39:40 2007
@@ -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