Skip to content

Commit 2893cdd

Browse files
committed
Added support for GHC >= 7.4 (via conditional compilation)
1 parent c0b4642 commit 2893cdd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/System/Plugins/Load.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ import Foreign.C.String ( CString, withCString, peekCString )
8888
import GHC ( defaultCallbacks )
8989
#endif
9090
import GHC.Ptr ( Ptr(..), nullPtr )
91+
#if !MIN_VERSION_ghc(7,4,1)
9192
import GHC.Exts ( addrToHValue# )
93+
#else
94+
import GHC.Exts ( addrToAny# )
95+
#endif
96+
9297
import GHC.Prim ( unsafeCoerce# )
9398

9499
#if DEBUG
@@ -451,7 +456,11 @@ loadFunction__ pkg m valsym
451456
ptr@(Ptr addr) <- withCString symbol c_lookupSymbol
452457
if (ptr == nullPtr)
453458
then return Nothing
459+
#if !MIN_VERSION_ghc(7,4,1)
454460
else case addrToHValue# addr of
461+
#else
462+
else case addrToAny# addr of
463+
#endif
455464
(# hval #) -> return ( Just hval )
456465

457466

0 commit comments

Comments
 (0)