Skip to content

Commit

Permalink
missing Castable instance for Ptr CBool and Ptr CFloat (#223)
Browse files Browse the repository at this point in the history
* missing Castable instance for Ptr CBool
* missing Castable (Ptr CFloat) (Ptr CFloat)
  • Loading branch information
wavewave committed Aug 15, 2023
1 parent a1ce045 commit 3be050d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 8 additions & 0 deletions fficxx-runtime/src/FFICXX/Runtime/Cast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ instance Castable Word64 Word64 where
cast x f = f x
uncast x f = f x

instance Castable (Ptr CBool) (Ptr CBool) where
cast x f = f x
uncast x f = f x

instance Castable (Ptr CInt) (Ptr CInt) where
cast x f = f x
uncast x f = f x
Expand All @@ -317,6 +321,10 @@ instance Castable (Ptr CLong) (Ptr CLong) where
cast x f = f x
uncast x f = f x

instance Castable (Ptr CFloat) (Ptr CFloat) where
cast x f = f x
uncast x f = f x

instance Castable (Ptr CDouble) (Ptr CDouble) where
cast x f = f x
uncast x f = f x
Expand Down
1 change: 0 additions & 1 deletion fficxx/src/FFICXX/Generate/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ simpleBuilder cfg sbc = do
for_ (cabal_additional_c_srcs cabal) (\(AddCSrc hdr txt) -> gen hdr txt)
--
putStrLn "Generating Enum.hsc"
debugExactPrint (C.buildEnumHsc mempty (topLevelMod <> ".Enum") enums)
gen
(topLevelMod <.> "Enum" <.> "hsc")
(exactPrint (C.buildEnumHsc mempty (topLevelMod <> ".Enum") enums))
Expand Down

0 comments on commit 3be050d

Please sign in to comment.