Make -fliberate-case work for GADTs
[ghc-hetmet.git] / ghc / compiler / ghci / ObjLink.lhs
index 7998f50..057938a 100644 (file)
@@ -12,12 +12,12 @@ Primarily, this module consists of an interface to the C-land dynamic linker.
 {-# OPTIONS -#include "Linker.h" #-}
 
 module ObjLink ( 
-   initLinker,  -- :: IO ()
-   loadDLL,     -- :: String -> IO (Maybe String)
-   loadObj,      -- :: String -> IO ()
-   unloadObj,    -- :: String -> IO ()
-   lookupSymbol, -- :: String -> IO (Maybe (Ptr a))
-   resolveObjs   -- :: IO SuccessFlag
+   initObjLinker,       -- :: IO ()
+   loadDLL,             -- :: String -> IO (Maybe String)
+   loadObj,             -- :: String -> IO ()
+   unloadObj,           -- :: String -> IO ()
+   lookupSymbol,        -- :: String -> IO (Maybe (Ptr a))
+   resolveObjs          -- :: IO SuccessFlag
   )  where
 
 import Monad            ( when )
@@ -25,8 +25,8 @@ import Monad            ( when )
 import Foreign.C
 import Foreign         ( Ptr, nullPtr )
 import Panic           ( panic )
-import DriverUtil       ( prefixUnderscore )
 import BasicTypes      ( SuccessFlag, successIf )
+import Config          ( cLeadingUnderscore )
 import Outputable
 
 -- ---------------------------------------------------------------------------
@@ -42,6 +42,11 @@ lookupSymbol str_in = do
        then return Nothing
        else return (Just addr)
 
+prefixUnderscore :: String -> String
+prefixUnderscore
+ | cLeadingUnderscore == "YES" = ('_':)
+ | otherwise                   = id
+
 loadDLL :: String -> IO (Maybe String)
 -- Nothing      => success
 -- Just err_msg => failure
@@ -75,7 +80,7 @@ resolveObjs = do
 
 #if __GLASGOW_HASKELL__ >= 504
 foreign import ccall unsafe "addDLL"      c_addDLL :: CString -> IO CString
-foreign import ccall unsafe "initLinker"   initLinker :: IO ()
+foreign import ccall unsafe "initLinker"   initObjLinker :: IO ()
 foreign import ccall unsafe "lookupSymbol" c_lookupSymbol :: CString -> IO (Ptr a)
 foreign import ccall unsafe "loadObj"      c_loadObj :: CString -> IO Int
 foreign import ccall unsafe "unloadObj"    c_unloadObj :: CString -> IO Int