-- addDependentFile examples/golden/binding-specs/fun_arg/macro/union.h -- #include -- void hs_bindgen_5da9ad143faecbca ( -- union MyUnion *arg1 -- ) -- { -- foo(*arg1); -- } -- void hs_bindgen_f70ba8b74da026b3 ( -- A *arg1 -- ) -- { -- fooA(*arg1); -- } -- void hs_bindgen_89e946b10b5189a6 ( -- B *arg1 -- ) -- { -- fooB(*arg1); -- } -- void hs_bindgen_f784f3292d76f05c ( -- union MyUnion *arg1 -- ) -- { -- foo(*arg1); -- } -- void hs_bindgen_317131bf91a541b2 ( -- A *arg1 -- ) -- { -- fooA(*arg1); -- } -- void hs_bindgen_d2ce062db2e5b039 ( -- B *arg1 -- ) -- { -- fooB(*arg1); -- } -- /* test_bindingspecsfun_argmacroun_Example_get_foo */ -- __attribute__ ((const)) -- void (*hs_bindgen_cda902505d180c3d (void)) ( -- union MyUnion arg1 -- ) -- { -- return &foo; -- } -- /* test_bindingspecsfun_argmacroun_Example_get_fooA */ -- __attribute__ ((const)) -- void (*hs_bindgen_d2d25b201a07a90e (void)) ( -- A arg1 -- ) -- { -- return &fooA; -- } -- /* test_bindingspecsfun_argmacroun_Example_get_fooB */ -- __attribute__ ((const)) -- void (*hs_bindgen_4f49b9aa9b0c125d (void)) ( -- B arg1 -- ) -- { -- return &fooB; -- } {-| __C declaration:__ @union MyUnion@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 4:7@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} newtype MyUnion = MyUnion {unwrapMyUnion :: ByteArray} {- ^ __C declaration:__ @union MyUnion@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 4:7@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} deriving via (SizedByteArray 4 4) instance StaticSize MyUnion deriving via (SizedByteArray 4 4) instance ReadRaw MyUnion deriving via (SizedByteArray 4 4) instance WriteRaw MyUnion deriving via (EquivStorable MyUnion) instance Storable MyUnion {-| __See:__ 'set_myUnion_x' __C declaration:__ @x@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 4:21@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} get_myUnion_x :: MyUnion -> CInt {-| __See:__ 'set_myUnion_x' __C declaration:__ @x@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 4:21@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} get_myUnion_x = getUnionPayload {-| __See:__ 'get_myUnion_x' -} set_myUnion_x :: CInt -> MyUnion {-| __See:__ 'get_myUnion_x' -} set_myUnion_x = setUnionPayload instance HasCField MyUnion "myUnion_x" where type CFieldType MyUnion "myUnion_x" = CInt offset# = \_ -> \_ -> 0 instance TyEq ty (CFieldType MyUnion "myUnion_x") => HasField "myUnion_x" (Ptr MyUnion) (Ptr ty) where getField = fromPtr (Proxy @"myUnion_x") {-| __C declaration:__ @A@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 7:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} newtype A = A {unwrapA :: MyUnion} {- ^ __C declaration:__ @A@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 7:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable) 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" = MyUnion offset# = \_ -> \_ -> 0 {-| __C declaration:__ @B@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 8:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} newtype B = B {unwrapB :: A} {- ^ __C declaration:__ @B@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 8:9@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable) 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_argmacroun_Example_Safe_foo@ foreign import ccall safe "hs_bindgen_5da9ad143faecbca" hs_bindgen_5da9ad143faecbca_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_foo@ hs_bindgen_5da9ad143faecbca :: Ptr MyUnion -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_foo@ hs_bindgen_5da9ad143faecbca = fromFFIType hs_bindgen_5da9ad143faecbca_base {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo :: MyUnion -> IO Unit {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo = \x_0 -> with x_0 (\x_1 -> hs_bindgen_5da9ad143faecbca x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooA@ foreign import ccall safe "hs_bindgen_f70ba8b74da026b3" hs_bindgen_f70ba8b74da026b3_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooA@ hs_bindgen_f70ba8b74da026b3 :: Ptr A -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooA@ hs_bindgen_f70ba8b74da026b3 = fromFFIType hs_bindgen_f70ba8b74da026b3_base {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA :: A -> IO Unit {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA = \x_0 -> with x_0 (\x_1 -> hs_bindgen_f70ba8b74da026b3 x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooB@ foreign import ccall safe "hs_bindgen_89e946b10b5189a6" hs_bindgen_89e946b10b5189a6_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooB@ hs_bindgen_89e946b10b5189a6 :: Ptr B -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Safe_fooB@ hs_bindgen_89e946b10b5189a6 = fromFFIType hs_bindgen_89e946b10b5189a6_base {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB :: B -> IO Unit {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB = \x_0 -> with x_0 (\x_1 -> hs_bindgen_89e946b10b5189a6 x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_foo@ foreign import ccall unsafe "hs_bindgen_f784f3292d76f05c" hs_bindgen_f784f3292d76f05c_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_foo@ hs_bindgen_f784f3292d76f05c :: Ptr MyUnion -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_foo@ hs_bindgen_f784f3292d76f05c = fromFFIType hs_bindgen_f784f3292d76f05c_base {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo :: MyUnion -> IO Unit {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo = \x_0 -> with x_0 (\x_1 -> hs_bindgen_f784f3292d76f05c x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooA@ foreign import ccall unsafe "hs_bindgen_317131bf91a541b2" hs_bindgen_317131bf91a541b2_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooA@ hs_bindgen_317131bf91a541b2 :: Ptr A -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooA@ hs_bindgen_317131bf91a541b2 = fromFFIType hs_bindgen_317131bf91a541b2_base {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA :: A -> IO Unit {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA = \x_0 -> with x_0 (\x_1 -> hs_bindgen_317131bf91a541b2 x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooB@ foreign import ccall unsafe "hs_bindgen_d2ce062db2e5b039" hs_bindgen_d2ce062db2e5b039_base :: Ptr Void -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooB@ hs_bindgen_d2ce062db2e5b039 :: Ptr B -> IO Unit -- __unique:__ @test_bindingspecsfun_argmacroun_Example_Unsafe_fooB@ hs_bindgen_d2ce062db2e5b039 = fromFFIType hs_bindgen_d2ce062db2e5b039_base {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB :: B -> IO Unit {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB = \x_0 -> with x_0 (\x_1 -> hs_bindgen_d2ce062db2e5b039 x_1) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_foo@ foreign import ccall unsafe "hs_bindgen_cda902505d180c3d" hs_bindgen_cda902505d180c3d_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_foo@ hs_bindgen_cda902505d180c3d :: IO (FunPtr (MyUnion -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_foo@ hs_bindgen_cda902505d180c3d = fromFFIType hs_bindgen_cda902505d180c3d_base {-# NOINLINE foo #-} {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo :: FunPtr (MyUnion -> IO Unit) {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} foo = unsafePerformIO hs_bindgen_cda902505d180c3d -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooA@ foreign import ccall unsafe "hs_bindgen_d2d25b201a07a90e" hs_bindgen_d2d25b201a07a90e_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooA@ hs_bindgen_d2d25b201a07a90e :: IO (FunPtr (A -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooA@ hs_bindgen_d2d25b201a07a90e = fromFFIType hs_bindgen_d2d25b201a07a90e_base {-# NOINLINE fooA #-} {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA :: FunPtr (A -> IO Unit) {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooA = unsafePerformIO hs_bindgen_d2d25b201a07a90e -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooB@ foreign import ccall unsafe "hs_bindgen_4f49b9aa9b0c125d" hs_bindgen_4f49b9aa9b0c125d_base :: IO (FunPtr Void) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooB@ hs_bindgen_4f49b9aa9b0c125d :: IO (FunPtr (B -> IO Unit)) -- __unique:__ @test_bindingspecsfun_argmacroun_Example_get_fooB@ hs_bindgen_4f49b9aa9b0c125d = fromFFIType hs_bindgen_4f49b9aa9b0c125d_base {-# NOINLINE fooB #-} {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB :: FunPtr (B -> IO Unit) {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/union.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/union.h@ -} fooB = unsafePerformIO hs_bindgen_4f49b9aa9b0c125d