File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
System/Posix/DynamicLinker Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,17 @@ data RTLDFlags
8585 | RTLD_LOCAL
8686 deriving (Show , Read )
8787
88+ #if defined(HAVE_DLFCN_H)
8889foreign import capi unsafe " dlfcn.h dlopen" c_dlopen :: CString -> CInt -> IO (Ptr () )
8990foreign import capi unsafe " dlfcn.h dlsym" c_dlsym :: Ptr () -> CString -> IO (FunPtr a )
9091foreign import capi unsafe " dlfcn.h dlerror" c_dlerror :: IO CString
9192foreign import capi unsafe " dlfcn.h dlclose" c_dlclose :: (Ptr () ) -> IO CInt
93+ #else
94+ foreign import ccall unsafe " dlopen" c_dlopen :: CString -> CInt -> IO (Ptr () )
95+ foreign import ccall unsafe " dlsym" c_dlsym :: Ptr () -> CString -> IO (FunPtr a )
96+ foreign import ccall unsafe " dlerror" c_dlerror :: IO CString
97+ foreign import ccall unsafe " dlclose" c_dlclose :: (Ptr () ) -> IO CInt
98+ #endif // HAVE_DLFCN_H
9299
93100packRTLDFlags :: [RTLDFlags ] -> CInt
94101packRTLDFlags flags = foldl (\ s f -> (packRTLDFlag f) .|. s) 0 flags
You can’t perform that action at this time.
0 commit comments