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
85
85
| RTLD_LOCAL
86
86
deriving (Show , Read )
87
87
88
+ #if defined(HAVE_DLFCN_H)
88
89
foreign import capi unsafe " dlfcn.h dlopen" c_dlopen :: CString -> CInt -> IO (Ptr () )
89
90
foreign import capi unsafe " dlfcn.h dlsym" c_dlsym :: Ptr () -> CString -> IO (FunPtr a )
90
91
foreign import capi unsafe " dlfcn.h dlerror" c_dlerror :: IO CString
91
92
foreign 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
92
99
93
100
packRTLDFlags :: [RTLDFlags ] -> CInt
94
101
packRTLDFlags flags = foldl (\ s f -> (packRTLDFlag f) .|. s) 0 flags
You can’t perform that action at this time.
0 commit comments