summaryrefslogtreecommitdiff
path: root/ghc/includes/mkNativeHdr.c
diff options
context:
space:
mode:
authorpanne <unknown>2002-07-21 11:46:34 +0000
committerpanne <unknown>2002-07-21 11:46:34 +0000
commit026fa45f1852a836a3bb182a76065da899c163cc (patch)
tree032930aabc43fe13cdd54dfe78570efdf6b21e05 /ghc/includes/mkNativeHdr.c
parent536497ade4f4c364974b06b9aa17d37e6251c2c6 (diff)
downloadhaskell-026fa45f1852a836a3bb182a76065da899c163cc.tar.gz
[project @ 2002-07-21 11:46:34 by panne]
Long explanation for small commit: With the recent reorganization of #includes, things get a little bit fragile: When gcc with -O is used, glibc's <stdio.h> defines a few inline functions (see <bits/stdio.h>), and "Stg.h" defines some global variables which reside in registers. But the latter must happen *before* any function definition has been seen, otherwise the generated code could be invalid. Consequently gcc complains like: In file included from Stg.h:182, from mkNativeHdr.c:12: Regs.h:293: global register variable follows a function definition Regs.h:302: global register variable follows a function definition The solution is quite simple: Always #include "Stg.h" *before* any system headers.
Diffstat (limited to 'ghc/includes/mkNativeHdr.c')
-rw-r--r--ghc/includes/mkNativeHdr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/includes/mkNativeHdr.c b/ghc/includes/mkNativeHdr.c
index c04d158ff3..8bf707bf36 100644
--- a/ghc/includes/mkNativeHdr.c
+++ b/ghc/includes/mkNativeHdr.c
@@ -1,5 +1,5 @@
/* --------------------------------------------------------------------------
- * $Id: mkNativeHdr.c,v 1.9 2002/07/17 09:21:49 simonmar Exp $
+ * $Id: mkNativeHdr.c,v 1.10 2002/07/21 11:46:34 panne Exp $
*
* (c) The GHC Team, 1992-1998
*
@@ -7,10 +7,10 @@
*
* ------------------------------------------------------------------------*/
-#include <stdio.h>
-
#include "Stg.h"
+#include <stdio.h>
+
#define OFFSET(table, x) ((StgUnion *) &(x) - (StgUnion *) (&table))
#define OFFSET_R1 OFFSET(RegTable, RegTable.rR1)