language-c-inline 0.7.7.0 → 0.7.8.0
raw patch · 2 files changed
+27/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
Language/C/Inline/ObjC/Marshal.hs view
@@ -77,6 +77,13 @@ else unknownType lang ty }+ haskellTypeToCType' lang ty@(ConT ptrC `AppT` argTy) -- pass vanilla pointers through (as per FFI spec)+ | ptrC == ''Ptr+ = return $ Just [cty| void* |]+ | ptrC == ''FunPtr+ = return $ Just [cty| void*(void) |]+ | ptrC == ''StablePtr+ = return $ Just [cty| void*(void) |] haskellTypeToCType' lang (ConT tc) -- nullary type constructors are delegated = haskellTypeNameToCType lang tc haskellTypeToCType' lang ty@(VarT tv) -- can't marshal an unknown type@@ -249,6 +256,13 @@ _ -> missingErr missingErr = reportErrorAndFail ObjC $ "missing 'Maybe' marshalling for '" ++ prettyQC cTy ++ "' to '" ++ TH.pprint hsTy ++ "'"+generateHaskellToCMarshaller' hsTy@(ConT ptrC `AppT` argTy) cTy+ | ptrC == ''Ptr || ptrC == ''FunPtr || ptrC == ''StablePtr+ = return ( return hsTy+ , cTy+ , \val cont -> [| $cont $val |]+ , \argName -> [cexp| $id:(show argName) |]+ ) generateHaskellToCMarshaller' hsTy cTy | Just hsMarshalTy <- Map.lookup cTy cIntegralMap -- checking whether it is an integral type = return ( hsMarshalTy@@ -365,6 +379,13 @@ _ -> missingErr missingErr = reportErrorAndFail ObjC $ "missing 'Maybe' marshalling for '" ++ prettyQC cTy ++ "' to '" ++ TH.pprint hsTy ++ "'"+generateCToHaskellMarshaller' hsTy@(ConT ptrC `AppT` argTy) cTy+ | ptrC == ''Ptr || ptrC == ''FunPtr || ptrC == ''StablePtr+ = return ( return hsTy+ , cTy+ , \val cont -> [| $cont $val |]+ , \argName -> [cexp| $id:(show argName) |]+ ) generateCToHaskellMarshaller' hsTy cTy | Just hsMarshalTy <- Map.lookup cTy cIntegralMap -- checking whether it is an integral type = return ( hsMarshalTy
language-c-inline.cabal view
@@ -1,7 +1,7 @@ Name: language-c-inline-Version: 0.7.7.0+Version: 0.7.8.0 Cabal-version: >= 1.9.2-Tested-with: GHC == 7.6.3, GHC == 7.8.2+Tested-with: GHC == 7.6.3, GHC == 7.8.3 Build-type: Simple Synopsis: Inline C & Objective-C code in Haskell for language interoperability@@ -16,10 +16,10 @@ . Known bugs: <https://github.com/mchakravarty/language-c-inline/issues> .- * New in 0.7.6: (1) Record marshalling; (2) foreign pointer-class marshalling; (3) custom type- marshallers. Generated _objc.m files now always include "HsFFI.h" (as the tool can generate type names- declared in that header). Marshals 'Bool' as 'BOOL'. Marshal 'Int' and 'Word' to 'NSInteger' and- 'NSUInteger', respectively.+ * New in 0.7.8: (1) Record marshalling; (2) foreign pointer-class marshalling; (3) custom type+ marshallers; (4) marshall raw pointer types. Generated _objc.m files now always include "HsFFI.h"+ (as the tool can generate type names declared in that header). Marshals 'Bool' as 'BOOL'. Marshal 'Int'+ and 'Word' to 'NSInteger' and 'NSUInteger', respectively. . * New in 0.6.0: Introduction of explicit marshalling hints (for more flexibility and support of GHC 7.8's untyped Template Haskell quotations)