[MLton-commit] r4481
Stephen Weeks
MLton@mlton.org
Sun, 7 May 2006 13:26:12 -0700
Moved the conditional definitions of FE_ and FP_ constants from
IEEEReal-consts.c to platform.h. They need to be accessible in other
files (e.g. basis/Real/class.c).
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c 2006-05-07 20:01:49 UTC (rev 4480)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/IEEEReal-consts.c 2006-05-07 20:26:11 UTC (rev 4481)
@@ -1,56 +1,11 @@
#include "platform.h"
-#if not HAS_FPCLASSIFY
-#ifndef FP_INFINITE
-#define FP_INFINITE 1
-#endif
-#ifndef FP_NAN
-#define FP_NAN 0
-#endif
-#ifndef FP_NORMAL
-#define FP_NORMAL 4
-#endif
-#ifndef FP_SUBNORMAL
-#define FP_SUBNORMAL 3
-#endif
-#ifndef FP_ZERO
-#define FP_ZERO 2
-#endif
-#endif
-
const C_Int_t IEEEReal_FloatClass_FP_INFINITE = FP_INFINITE;
const C_Int_t IEEEReal_FloatClass_FP_NAN = FP_NAN;
const C_Int_t IEEEReal_FloatClass_FP_NORMAL = FP_NORMAL;
const C_Int_t IEEEReal_FloatClass_FP_SUBNORMAL = FP_SUBNORMAL;
const C_Int_t IEEEReal_FloatClass_FP_ZERO = FP_ZERO;
-
-#define FE_NOSUPPORT -1
-
-/* Can't handle undefined rounding modes with code like the following.
- * #ifndef FE_TONEAREST
- * #define FE_TONEAREST FE_NOSUPPORT
- * #endif
- * On some platforms, FE_* are defined via an enum, not the
- * preprocessor, and hence don't show up as #defined. In that case,
- * the below code overwrites them.
- */
-
-#if not HAS_FEROUND
-#ifndef FE_TONEAREST
-#define FE_TONEAREST 0
-#endif
-#ifndef FE_DOWNWARD
-#define FE_DOWNWARD 1
-#endif
-#ifndef FE_UPWARD
-#define FE_UPWARD 2
-#endif
-#ifndef FE_TOWARDZERO
-#define FE_TOWARDZERO 3
-#endif
-#endif
-
const C_Int_t IEEEReal_RoundingMode_FE_TONEAREST = FE_TONEAREST;
const C_Int_t IEEEReal_RoundingMode_FE_DOWNWARD = FE_DOWNWARD;
const C_Int_t IEEEReal_RoundingMode_FE_NOSUPPORT = FE_NOSUPPORT;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-07 20:01:49 UTC (rev 4480)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2006-05-07 20:26:11 UTC (rev 4481)
@@ -83,6 +83,50 @@
#define SPAWN_MODE 0
#endif
+#if not HAS_FPCLASSIFY
+#ifndef FP_INFINITE
+#define FP_INFINITE 1
+#endif
+#ifndef FP_NAN
+#define FP_NAN 0
+#endif
+#ifndef FP_NORMAL
+#define FP_NORMAL 4
+#endif
+#ifndef FP_SUBNORMAL
+#define FP_SUBNORMAL 3
+#endif
+#ifndef FP_ZERO
+#define FP_ZERO 2
+#endif
+#endif
+
+#define FE_NOSUPPORT -1
+
+/* Can't handle undefined rounding modes with code like the following.
+ * #ifndef FE_TONEAREST
+ * #define FE_TONEAREST FE_NOSUPPORT
+ * #endif
+ * On some platforms, FE_* are defined via an enum, not the
+ * preprocessor, and hence don't show up as #defined. In that case,
+ * the below code overwrites them.
+ */
+
+#if not HAS_FEROUND
+#ifndef FE_TONEAREST
+#define FE_TONEAREST 0
+#endif
+#ifndef FE_DOWNWARD
+#define FE_DOWNWARD 1
+#endif
+#ifndef FE_UPWARD
+#define FE_UPWARD 2
+#endif
+#ifndef FE_TOWARDZERO
+#define FE_TOWARDZERO 3
+#endif
+#endif
+
#include "ml-types.h"
#include "c-types.h"
#include "basis-ffi.h"