Commit eb6fb4cf authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-13 15:43:36 by simonmar]

resolveObjs now returns a Bool, indicating success
parent e2d33dee
...@@ -14,7 +14,7 @@ module Linker ( ...@@ -14,7 +14,7 @@ module Linker (
loadObj, -- :: String -> IO () loadObj, -- :: String -> IO ()
unloadObj, -- :: String -> IO () unloadObj, -- :: String -> IO ()
lookupSymbol, -- :: String -> IO (Maybe (Ptr a)) lookupSymbol, -- :: String -> IO (Maybe (Ptr a))
resolveObjs, -- :: IO () resolveObjs, -- :: IO Bool
addDLL -- :: String -> IO (Ptr CChar) addDLL -- :: String -> IO (Ptr CChar)
) where ) where
...@@ -53,9 +53,7 @@ unloadObj str = do ...@@ -53,9 +53,7 @@ unloadObj str = do
resolveObjs = do resolveObjs = do
r <- c_resolveObjs r <- c_resolveObjs
if (r == 0) return (r /= 0) -- returns True <=> success
then panic "resolveObjs: failed"
else return ()
addDLL path lib = do addDLL path lib = do
maybe_errmsg <- c_addDLL (packString path) (packString lib) maybe_errmsg <- c_addDLL (packString path) (packString lib)
...@@ -80,5 +78,4 @@ foreign import "initLinker" unsafe ...@@ -80,5 +78,4 @@ foreign import "initLinker" unsafe
foreign import "addDLL" unsafe foreign import "addDLL" unsafe
c_addDLL :: PackedString -> PackedString -> IO (Ptr CChar) c_addDLL :: PackedString -> PackedString -> IO (Ptr CChar)
\end{code} \end{code}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment