Unbreak the GHC build with older versions of gcc
authorIan Lynagh <igloo@earth.li>
Thu, 4 Sep 2008 18:51:22 +0000 (18:51 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 4 Sep 2008 18:51:22 +0000 (18:51 +0000)
Patch from kili@outback.escape.de, who says:
  Stg.h must be included before HsBase.h, because the latter contains
  function definitions causing older versions of gcc (3.3.5 in my
  case) to bail out with "error: global register variable follows a
  function definition" on Regs.h, which is included by Stg.h.

cbits/PrelIOUtils.c

index c1999af..be97876 100644 (file)
@@ -5,9 +5,14 @@
  */
 
 #define INLINE
-#include "HsBase.h"
+
 #ifdef __GLASGOW_HASKELL__
 # include "Stg.h"
+#endif
+
+#include "HsBase.h"
+
+#ifdef __GLASGOW_HASKELL__
 # include "RtsMessages.h"
 
 void errorBelch2(const char*s, char *t)