[project @ 2003-05-30 09:06:24 by simonmar]
[ghc-hetmet.git] / ghc / rts / Linker.c
index c9578fe..7d9a550 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.118 2003/03/31 14:02:32 simonmar Exp $
+ * $Id: Linker.c,v 1.120 2003/05/30 09:06:24 simonmar Exp $
  *
  * (c) The GHC Team, 2000-2003
  *
@@ -92,7 +92,7 @@ static int ocVerifyImage_MachO    ( ObjectCode* oc );
 static int ocGetNames_MachO       ( ObjectCode* oc );
 static int ocResolve_MachO        ( ObjectCode* oc );
 
-static void machoInitSymbolsWithoutUnderscore();
+static void machoInitSymbolsWithoutUnderscore( void );
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -214,6 +214,15 @@ typedef struct _RtsSymbolVal {
 #define RTS_POSIX_ONLY_SYMBOLS  /**/
 #define RTS_CYGWIN_ONLY_SYMBOLS /**/
 
+/* Extra syms gen'ed by mingw-2's gcc-3.2: */
+#if __GNUC__>=3
+#define RTS_MINGW_EXTRA_SYMS                    \
+      Sym(_imp____mb_cur_max)                   \
+      Sym(_imp___pctype)            
+#else
+#define RTS_MINGW_EXTRA_SYMS
+#endif
+
 /* These are statically linked from the mingw libraries into the ghc
    executable, so we have to employ this hack. */
 #define RTS_MINGW_ONLY_SYMBOLS                  \
@@ -278,6 +287,7 @@ typedef struct _RtsSymbolVal {
       Sym(opendir)                              \
       Sym(readdir)                              \
       Sym(rewinddir)                            \
+      RTS_MINGW_EXTRA_SYMS                      \
       Sym(closedir)
 #endif
 
@@ -551,15 +561,17 @@ typedef struct _RtsSymbolVal {
 /* force these symbols to be present */
 #define RTS_EXTRA_SYMBOLS                      \
       Sym(__divsf3)
-#elif defined(powerpc_TARGET_ARCH)
+#else
+#define RTS_EXTRA_SYMBOLS /* nothing */
+#endif
+
+#ifdef darwin_TARGET_OS
       // Symbols that don't have a leading underscore
       // on Mac OS X. They have to receive special treatment,
       // see machoInitSymbolsWithoutUnderscore()
 #define RTS_MACHO_NOUNDERLINE_SYMBOLS          \
       Sym(saveFP)                              \
       Sym(restFP)
-#else
-#define RTS_EXTRA_SYMBOLS /* nothing */
 #endif
 
 /* entirely bogus claims about types of these symbols */