projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2004-01-08 10:45:33 by simonmar]
[ghc-hetmet.git]
/
ghc
/
includes
/
Rts.h
diff --git
a/ghc/includes/Rts.h
b/ghc/includes/Rts.h
index
264857b
..
b0ad6ea
100644
(file)
--- a/
ghc/includes/Rts.h
+++ b/
ghc/includes/Rts.h
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: Rts.h,v 1.14 2001/10/29 11:33:37 simonmar Exp $
+ * $Id: Rts.h,v 1.23 2003/11/12 17:27:03 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
@@
-23,14
+23,6
@@
extern "C" {
RTS Exit codes
-------------------------------------------------------------------------- */
RTS Exit codes
-------------------------------------------------------------------------- */
-#if ! defined(EXIT_SUCCESS) || ! defined(EXIT_FAILURE)
-/* "stdlib.h" should have defined these; but at least
- on SunOS 4.1.3, this is not so.
-*/
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-#endif
-
/* 255 is allegedly used by dynamic linkers to report linking failure */
#define EXIT_INTERNAL_ERROR 254
#define EXIT_DEADLOCK 253
/* 255 is allegedly used by dynamic linkers to report linking failure */
#define EXIT_INTERNAL_ERROR 254
#define EXIT_DEADLOCK 253
@@
-45,6
+37,14
@@
extern "C" {
/* declarations for runtime flags/values */
#define MAX_RTS_ARGS 32
/* declarations for runtime flags/values */
#define MAX_RTS_ARGS 32
+#ifdef _WIN32
+/* On the yucky side..suppress -Wmissing-declarations warnings when
+ * including <windows.h>
+ */
+extern void* GetCurrentFiber ( void );
+extern void* GetFiberData ( void );
+#endif
+
/* -----------------------------------------------------------------------------
Assertions and Debuggery
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
Assertions and Debuggery
-------------------------------------------------------------------------- */
@@
-61,6
+61,12
@@
extern "C" {
#define IF_DEBUG(c,s) doNothing()
#endif
#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
#if defined(GRAN) && defined(DEBUG)
#define IF_GRAN_DEBUG(c,s) if (RtsFlags.GranFlags.Debug.c) { s; }
#else
@@
-78,7
+84,7
@@
extern "C" {
-------------------------------------------------------------------------- */
#ifdef __GNUC__ /* Avoid spurious warnings */
-------------------------------------------------------------------------- */
#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
#define STG_NORETURN __attribute__ ((noreturn))
#define STG_UNUSED __attribute__ ((unused))
#else
@@
-90,20
+96,21
@@
extern "C" {
#define STG_UNUSED
#endif
#define STG_UNUSED
#endif
+#if defined(__GNUC__)
+#define SUPPORTS_TYPEOF
+#endif
+
/* -----------------------------------------------------------------------------
Useful macros and inline functions
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
Useful macros and inline functions
-------------------------------------------------------------------------- */
-/*
- * Use this on the RHS of macros which expand to nothing
- * to make sure that the macro can be used in a context which
- * demands a non-empty statement.
- */
-
-#define doNothing() do { } while (0)
-
+#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; })
#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
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */