/* Needed to get the macro version of errno on some OSs, and also to
get prototypes for the _r versions of C library functions. */
+#ifndef _REENTRANT
#define _REENTRANT 1
+#endif
/*
* We often want to know the size of something in units of an
/* -----------------------------------------------------------------------------
Assertions and Debuggery
- -------------------------------------------------------------------------- */
-#ifndef DEBUG
-#define ASSERT(predicate) /* nothing */
-#else
+ CHECK(p) evaluates p and terminates with an error if p is false
+ ASSERT(p) like CHECK(p) if DEBUG is on, otherwise a no-op
+ -------------------------------------------------------------------------- */
extern void _assertFail (const char *, unsigned int);
-#define ASSERT(predicate) \
+#define CHECK(predicate) \
if (predicate) \
/*null*/; \
else \
_assertFail(__FILE__, __LINE__)
+
+#ifndef DEBUG
+#define ASSERT(predicate) /* nothing */
+#else
+#define ASSERT(predicate) CHECK(predicate)
#endif /* DEBUG */
/*
#include "SMPClosureOps.h"
#include "SpinLock.h"
-/* GNU mp library */
-#if defined(HAVE_FRAMEWORK_GMP)
-#include <GMP/gmp.h>
-#else
-#include "gmp.h"
-#endif
-
/* Macros for STG/C code */
#include "Block.h"
#include "ClosureMacros.h"
extern void stackOverflow(void);
-extern void __decodeDouble (MP_INT *man, I_ *_exp, StgDouble dbl);
-extern void __decodeFloat (MP_INT *man, I_ *_exp, StgFloat flt);
extern void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl);
extern void __decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt);