packages feed

clr-host 0.2.0 → 0.2.0.1

raw patch · 3 files changed

+11/−5 lines, 3 files

Files

clr-host.cabal view
@@ -1,5 +1,5 @@ name:                clr-host-version:             0.2.0+version:             0.2.0.1 synopsis:            Hosting the Common Language Runtime description:         clr-host is a library that provides the ability to host (also known as embed) the                      common language runtime within the current Haskell process. Generally you'll only
src/Clr/Host.hs view
@@ -1,7 +1,8 @@ {-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} -module Clr.Host where+module Clr.Host (startClr, stopClr, withClr) where +import Control.Exception import Clr.Marshal  import Clr.Host.Config@@ -20,6 +21,7 @@ import Foreign.Ptr  +{-# DEPRECATED startClr, stopClr "Use withClr" #-} startClr :: IO () startClr = do   ClrHostConfig hostType <- getClrHostConfig@@ -42,7 +44,8 @@ stopClr :: IO () stopClr = putStrLn "stopClr" -+withClr :: IO a -> IO a+withClr = bracket_ startClr stopClr   
src/Clr/Host/DotNet.hs view
@@ -38,8 +38,11 @@ foreign import ccall "dotNetHost.c setHostRefs"        setHostRefs        :: ICorRuntimeHost -> ICLRRuntimeHost -> IO ()  #if x86_64_HOST_ARCH-foreign import ccall __unregister_hs_exception_handler :: IO ()-unregister_hs_exception_handler = __unregister_hs_exception_handler+-- 1. binding to __unregister_hs_exception_handler doesn't work reliably e.g. in ghci+-- 2. Calling unregister_hs_exception_handler crashes if no exception handler has been registered previously.+--    This is a problem in 8.2 where it appears the handler is not installed at startup and "main = startClr" crashes.+-- foreign import ccall __unregister_hs_exception_handler :: IO ()+unregister_hs_exception_handler = return () -- __unregister_hs_exception_handler #else -- symbol has extra leading underscore on 32 bit apprently --foreign import ccall ___unregister_hs_exception_handler :: IO ()