[project @ 2001-08-13 15:43:36 by simonmar]
authorsimonmar <unknown>
Mon, 13 Aug 2001 15:43:36 +0000 (15:43 +0000)
committersimonmar <unknown>
Mon, 13 Aug 2001 15:43:36 +0000 (15:43 +0000)
resolveObjs now returns a Bool, indicating success

ghc/compiler/ghci/Linker.lhs

index 5d16633..e7fb278 100644 (file)
@@ -14,7 +14,7 @@ module Linker (
    loadObj,      -- :: String -> IO ()
    unloadObj,    -- :: String -> IO ()
    lookupSymbol, -- :: String -> IO (Maybe (Ptr a))
-   resolveObjs,  -- :: IO ()
+   resolveObjs,  -- :: IO Bool
    addDLL       -- :: String -> IO (Ptr CChar)
   )  where
 
@@ -53,9 +53,7 @@ unloadObj str = do
 
 resolveObjs = do
    r <- c_resolveObjs
-   if (r == 0)
-       then panic "resolveObjs: failed"
-       else return ()
+   return (r /= 0)  -- returns True <=> success
 
 addDLL path lib = do
    maybe_errmsg <- c_addDLL (packString path) (packString lib)
@@ -80,5 +78,4 @@ foreign import "initLinker" unsafe
 
 foreign import "addDLL" unsafe 
    c_addDLL :: PackedString -> PackedString -> IO (Ptr CChar)
-
 \end{code}