From 2893cdd167ba4b9ff70a2b9ecefc57a8d69ff1d8 Mon Sep 17 00:00:00 2001 From: Ben Gamari <bgamari.foss@gmail.com> Date: Mon, 19 Mar 2012 18:22:53 +0000 Subject: [PATCH] Added support for GHC >= 7.4 (via conditional compilation) --- src/System/Plugins/Load.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/System/Plugins/Load.hs b/src/System/Plugins/Load.hs index f3c0c60..bb926c7 100644 --- a/src/System/Plugins/Load.hs +++ b/src/System/Plugins/Load.hs @@ -88,7 +88,12 @@ import Foreign.C.String ( CString, withCString, peekCString ) import GHC ( defaultCallbacks ) #endif import GHC.Ptr ( Ptr(..), nullPtr ) +#if !MIN_VERSION_ghc(7,4,1) import GHC.Exts ( addrToHValue# ) +#else +import GHC.Exts ( addrToAny# ) +#endif + import GHC.Prim ( unsafeCoerce# ) #if DEBUG @@ -451,7 +456,11 @@ loadFunction__ pkg m valsym ptr@(Ptr addr) <- withCString symbol c_lookupSymbol if (ptr == nullPtr) then return Nothing +#if !MIN_VERSION_ghc(7,4,1) else case addrToHValue# addr of +#else + else case addrToAny# addr of +#endif (# hval #) -> return ( Just hval )