Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hs-bindgen-runtime/hs-bindgen-runtime.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ library
HsBindgen.Runtime.ConstantArray
HsBindgen.Runtime.FlexibleArrayMember
HsBindgen.Runtime.FunPtr
HsBindgen.Runtime.HasBaseForeignType
HsBindgen.Runtime.HasCField
HsBindgen.Runtime.IncompleteArray
HsBindgen.Runtime.LibC
Expand Down
9 changes: 8 additions & 1 deletion hs-bindgen-runtime/src/HsBindgen/Runtime/Block.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE UndecidableInstances #-}

-- | Bare-bones support for blocks
--
-- TODO: Ideally we would at least support @Block_copy@ and @Block_release@.
Expand All @@ -7,7 +9,10 @@ module HsBindgen.Runtime.Block (
Block(..)
) where

import Foreign
import Foreign (Ptr)

import HsBindgen.Runtime.HasBaseForeignType (HasBaseForeignType,
ViaNewtype (..))

{-------------------------------------------------------------------------------
Definition
Expand All @@ -27,3 +32,5 @@ import Foreign
--
-- > newtype VarCounter = VarCounter (Block (CInt -> IO CInt))
newtype Block t = Block (Ptr ())

deriving via ViaNewtype (Ptr ()) instance HasBaseForeignType (Block t)
Loading
Loading