-#ifdef __GNUC__ /* Avoid spurious warnings */
-#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 7
-#define STG_NORETURN __attribute__ ((noreturn))
-#define STG_UNUSED __attribute__ ((unused))
+/* 255 is allegedly used by dynamic linkers to report linking failure */
+#define EXIT_INTERNAL_ERROR 254
+#define EXIT_DEADLOCK 253
+#define EXIT_INTERRUPTED 252
+#define EXIT_HEAPOVERFLOW 251
+#define EXIT_KILLED 250
+
+/* -----------------------------------------------------------------------------
+ Miscellaneous garbage
+ -------------------------------------------------------------------------- */
+
+/* declarations for runtime flags/values */
+#define MAX_RTS_ARGS 32
+
+/* -----------------------------------------------------------------------------
+ Assertions and Debuggery
+ -------------------------------------------------------------------------- */
+
+#define IF_RTSFLAGS(c,s) if (RtsFlags.c) { s; }
+
+/* -----------------------------------------------------------------------------
+ Assertions and Debuggery
+ -------------------------------------------------------------------------- */
+
+#ifdef DEBUG
+#define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; }
+#else
+#define IF_DEBUG(c,s) doNothing()
+#endif
+
+#ifdef DEBUG
+#define DEBUG_ONLY(s) s
+#else
+#define DEBUG_ONLY(s) doNothing()
+#endif
+
+#if defined(GRAN) && defined(DEBUG)
+#define IF_GRAN_DEBUG(c,s) if (RtsFlags.GranFlags.Debug.c) { s; }