[project @ 2001-05-15 15:01:48 by sewardj]
authorsewardj <unknown>
Tue, 15 May 2001 15:01:48 +0000 (15:01 +0000)
committersewardj <unknown>
Tue, 15 May 2001 15:01:48 +0000 (15:01 +0000)
Handle leading underscores correctly, for ghci on Win32.

ghc/compiler/ghci/Linker.lhs

index 8b0d15a..1d3e7b7 100644 (file)
@@ -5,6 +5,10 @@
 
 \begin{code}
 {-# OPTIONS -#include "Linker.h" #-}
+
+-- so that we can see defn of LEADING_UNDERSCORE
+#include "../includes/config.h"
+
 module Linker ( 
    initLinker,  -- :: IO ()
    loadObj,      -- :: String -> IO ()
@@ -24,7 +28,12 @@ import Panic         ( panic )
 -- RTS Linker Interface
 -- ---------------------------------------------------------------------------
 
-lookupSymbol str = do
+lookupSymbol str_in = do
+#  ifdef LEADING_UNDERSCORE
+   let str = '_':str_in
+#  else
+   let str = str_in
+#  endif
    addr <- c_lookupSymbol (packString str)
    if addr == nullPtr
        then return Nothing