[project @ 2003-12-10 11:35:24 by wolfgang]
[ghc-hetmet.git] / ghc / includes / Rts.h
index 565b035..b0ad6ea 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Rts.h,v 1.19 2002/07/18 06:07:37 sof Exp $
+ * $Id: Rts.h,v 1.23 2003/11/12 17:27:03 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -61,6 +61,12 @@ extern void* GetFiberData ( void );
 #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; }
 #else
@@ -78,7 +84,7 @@ extern void* GetFiberData ( void );
    -------------------------------------------------------------------------- */
 
 #ifdef __GNUC__     /* Avoid spurious warnings                             */
-#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 7
+#if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ >= 3
 #define STG_NORETURN  __attribute__ ((noreturn))
 #define STG_UNUSED    __attribute__ ((unused))
 #else
@@ -90,12 +96,21 @@ extern void* GetFiberData ( void );
 #define STG_UNUSED
 #endif
 
+#if defined(__GNUC__)
+#define SUPPORTS_TYPEOF
+#endif
+
 /* -----------------------------------------------------------------------------
    Useful macros and inline functions
    -------------------------------------------------------------------------- */
 
+#if defined(SUPPORTS_TYPEOF)
 #define stg_min(a,b) ({typeof(a) _a = (a), _b = (b); _a <= _b ? _a : _b; })
 #define stg_max(a,b) ({typeof(a) _a = (a), _b = (b); _a <= _b ? _b : _a; })
+#else
+#define stg_min(a,b) ((a) <= (b) ? (a) : (b))
+#define stg_max(a,b) ((a) <= (b) ? (b) : (a))
+#endif
 
 /* -------------------------------------------------------------------------- */