-- addDependentFile examples/golden/binding-specs/fun_arg/macro/function_pointer.h -- #include -- void hs_bindgen_40e15e86e5db36ce ( -- MyFunctionPointer arg1 -- ) -- { -- foo(arg1); -- } -- void hs_bindgen_e13a57fd1d27f6e6 ( -- A arg1 -- ) -- { -- fooA(arg1); -- } -- void hs_bindgen_fd490df5087893ae ( -- B arg1 -- ) -- { -- fooB(arg1); -- } -- void hs_bindgen_fbc2ec26cd297034 ( -- MyFunctionPointer arg1 -- ) -- { -- foo(arg1); -- } -- void hs_bindgen_cf67e2fc00fd28d8 ( -- A arg1 -- ) -- { -- fooA(arg1); -- } -- void hs_bindgen_269a46f9680e33ed ( -- B arg1 -- ) -- { -- fooB(arg1); -- } -- /* test_bindingspecsfun_argmacrofu_Example_get_foo */ -- __attribute__ ((const)) -- void (*hs_bindgen_e113ab1229902001 (void)) ( -- MyFunctionPointer arg1 -- ) -- { -- return &foo; -- } -- /* test_bindingspecsfun_argmacrofu_Example_get_fooA */ -- __attribute__ ((const)) -- void (*hs_bindgen_5e83648377d8afc6 (void)) ( -- A arg1 -- ) -- { -- return &fooA; -- } -- /* test_bindingspecsfun_argmacrofu_Example_get_fooB */ -- __attribute__ ((const)) -- void (*hs_bindgen_d6d79c737e65f7e7 (void)) ( -- B arg1 -- ) -- { -- return &fooB; -- } {-| Auxiliary type used by 'MyFunctionPointer' __C declaration:__ @MyFunctionPointer@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 4:15@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} newtype MyFunctionPointer_Aux = MyFunctionPointer_Aux {unwrapMyFunctionPointer_Aux :: (CInt -> IO CInt)} {- ^ Auxiliary type used by 'MyFunctionPointer' __C declaration:__ @MyFunctionPointer@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 4:15@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} deriving newtype HasFFIType foreign import ccall safe "wrapper" hs_bindgen_47dfd04698dd2e6f_base :: Int32 -> IO Int32 -> IO (FunPtr (Int32 -> IO Int32)) -- __unique:__ @toMyFunctionPointer_Aux@ hs_bindgen_47dfd04698dd2e6f :: MyFunctionPointer_Aux -> IO (FunPtr MyFunctionPointer_Aux) -- __unique:__ @toMyFunctionPointer_Aux@ hs_bindgen_47dfd04698dd2e6f = \fun_0 -> fmap castFunPtrFromFFIType (hs_bindgen_47dfd04698dd2e6f_base (toFFIType fun_0)) foreign import ccall safe "dynamic" hs_bindgen_5738272f94a589e2_base :: FunPtr (Int32 -> IO Int32) -> Int32 -> IO Int32 -- __unique:__ @fromMyFunctionPointer_Aux@ hs_bindgen_5738272f94a589e2 :: FunPtr MyFunctionPointer_Aux -> MyFunctionPointer_Aux -- __unique:__ @fromMyFunctionPointer_Aux@ hs_bindgen_5738272f94a589e2 = \funPtr_0 -> fromFFIType (hs_bindgen_5738272f94a589e2_base (castFunPtrToFFIType funPtr_0)) instance ToFunPtr MyFunctionPointer_Aux where toFunPtr = hs_bindgen_47dfd04698dd2e6f instance FromFunPtr MyFunctionPointer_Aux where fromFunPtr = hs_bindgen_5738272f94a589e2 instance TyEq ty (CFieldType MyFunctionPointer_Aux "unwrapMyFunctionPointer_Aux") => HasField "unwrapMyFunctionPointer_Aux" (Ptr MyFunctionPointer_Aux) (Ptr ty) where getField = fromPtr (Proxy @"unwrapMyFunctionPointer_Aux") instance HasCField MyFunctionPointer_Aux "unwrapMyFunctionPointer_Aux" where type CFieldType MyFunctionPointer_Aux "unwrapMyFunctionPointer_Aux" = CInt -> IO CInt offset# = \_ -> \_ -> 0 {-| __C declaration:__ @MyFunctionPointer@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 4:15@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} newtype MyFunctionPointer = MyFunctionPointer {unwrapMyFunctionPointer :: (FunPtr MyFunctionPointer_Aux)} {- ^ __C declaration:__ @MyFunctionPointer@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 4:15@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} deriving stock (Eq, Ord, Show) deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable, HasFFIType) instance TyEq ty (CFieldType MyFunctionPointer "unwrapMyFunctionPointer") => HasField "unwrapMyFunctionPointer" (Ptr MyFunctionPointer) (Ptr ty) where getField = fromPtr (Proxy @"unwrapMyFunctionPointer") instance HasCField MyFunctionPointer "unwrapMyFunctionPointer" where type CFieldType MyFunctionPointer "unwrapMyFunctionPointer" = FunPtr MyFunctionPointer_Aux offset# = \_ -> \_ -> 0 {-| __C declaration:__ @A@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 7:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} newtype A = A {unwrapA :: MyFunctionPointer} {- ^ __C declaration:__ @A@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 7:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} deriving stock (Eq, Ord, Show) deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable, HasFFIType) instance TyEq ty (CFieldType A "unwrapA") => HasField "unwrapA" (Ptr A) (Ptr ty) where getField = fromPtr (Proxy @"unwrapA") instance HasCField A "unwrapA" where type CFieldType A "unwrapA" = MyFunctionPointer offset# = \_ -> \_ -> 0 {-| __C declaration:__ @B@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 8:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} newtype B = B {unwrapB :: A} {- ^ __C declaration:__ @B@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 8:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} deriving stock (Eq, Ord, Show) deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable, HasFFIType) instance TyEq ty (CFieldType B "unwrapB") => HasField "unwrapB" (Ptr B) (Ptr ty) where getField = fromPtr (Proxy @"unwrapB") instance HasCField B "unwrapB" where type CFieldType B "unwrapB" = A offset# = \_ -> \_ -> 0 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_foo@ foreign import ccall safe "hs_bindgen_40e15e86e5db36ce" hs_bindgen_40e15e86e5db36ce_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_foo@ hs_bindgen_40e15e86e5db36ce :: MyFunctionPointer -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_foo@ hs_bindgen_40e15e86e5db36ce = fromFFIType hs_bindgen_40e15e86e5db36ce_base {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo :: MyFunctionPointer -> IO Unit {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo = hs_bindgen_40e15e86e5db36ce -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooA@ foreign import ccall safe "hs_bindgen_e13a57fd1d27f6e6" hs_bindgen_e13a57fd1d27f6e6_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooA@ hs_bindgen_e13a57fd1d27f6e6 :: A -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooA@ hs_bindgen_e13a57fd1d27f6e6 = fromFFIType hs_bindgen_e13a57fd1d27f6e6_base {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA :: A -> IO Unit {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA = hs_bindgen_e13a57fd1d27f6e6 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooB@ foreign import ccall safe "hs_bindgen_fd490df5087893ae" hs_bindgen_fd490df5087893ae_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooB@ hs_bindgen_fd490df5087893ae :: B -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooB@ hs_bindgen_fd490df5087893ae = fromFFIType hs_bindgen_fd490df5087893ae_base {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB :: B -> IO Unit {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB = hs_bindgen_fd490df5087893ae -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_foo@ foreign import ccall unsafe "hs_bindgen_fbc2ec26cd297034" hs_bindgen_fbc2ec26cd297034_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_foo@ hs_bindgen_fbc2ec26cd297034 :: MyFunctionPointer -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_foo@ hs_bindgen_fbc2ec26cd297034 = fromFFIType hs_bindgen_fbc2ec26cd297034_base {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo :: MyFunctionPointer -> IO Unit {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo = hs_bindgen_fbc2ec26cd297034 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooA@ foreign import ccall unsafe "hs_bindgen_cf67e2fc00fd28d8" hs_bindgen_cf67e2fc00fd28d8_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooA@ hs_bindgen_cf67e2fc00fd28d8 :: A -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooA@ hs_bindgen_cf67e2fc00fd28d8 = fromFFIType hs_bindgen_cf67e2fc00fd28d8_base {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA :: A -> IO Unit {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA = hs_bindgen_cf67e2fc00fd28d8 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooB@ foreign import ccall unsafe "hs_bindgen_269a46f9680e33ed" hs_bindgen_269a46f9680e33ed_base :: FunPtr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooB@ hs_bindgen_269a46f9680e33ed :: B -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Unsafe_fooB@ hs_bindgen_269a46f9680e33ed = fromFFIType hs_bindgen_269a46f9680e33ed_base {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB :: B -> IO Unit {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB = hs_bindgen_269a46f9680e33ed -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_foo@ foreign import ccall unsafe "hs_bindgen_e113ab1229902001" hs_bindgen_e113ab1229902001_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_foo@ hs_bindgen_e113ab1229902001 :: IO (FunPtr (MyFunctionPointer -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_foo@ hs_bindgen_e113ab1229902001 = fromFFIType hs_bindgen_e113ab1229902001_base {-# NOINLINE foo #-} {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo :: FunPtr (MyFunctionPointer -> IO Unit) {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo = unsafePerformIO hs_bindgen_e113ab1229902001 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooA@ foreign import ccall unsafe "hs_bindgen_5e83648377d8afc6" hs_bindgen_5e83648377d8afc6_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooA@ hs_bindgen_5e83648377d8afc6 :: IO (FunPtr (A -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooA@ hs_bindgen_5e83648377d8afc6 = fromFFIType hs_bindgen_5e83648377d8afc6_base {-# NOINLINE fooA #-} {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA :: FunPtr (A -> IO Unit) {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA = unsafePerformIO hs_bindgen_5e83648377d8afc6 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooB@ foreign import ccall unsafe "hs_bindgen_d6d79c737e65f7e7" hs_bindgen_d6d79c737e65f7e7_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooB@ hs_bindgen_d6d79c737e65f7e7 :: IO (FunPtr (B -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_get_fooB@ hs_bindgen_d6d79c737e65f7e7 = fromFFIType hs_bindgen_d6d79c737e65f7e7_base {-# NOINLINE fooB #-} {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB :: FunPtr (B -> IO Unit) {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB = unsafePerformIO hs_bindgen_d6d79c737e65f7e7