packages feed

hs-bindgen-1.0.0.0: test-artefacts/fixtures/macros/redeclaration/identical_semantics/th.txt

-- addDependentFile test-artefacts/headers/golden/macros/redeclaration/identical_semantics.h
-- #include <macros/redeclaration/identical_semantics.h>
-- void hs_bindgen_3a672aa51059499f (
--   T arg1
-- )
-- {
--   (foo)(arg1);
-- }
-- void hs_bindgen_f6ce0c67437e90e7 (
--   T arg1
-- )
-- {
--   (bar)(arg1);
-- }
-- void hs_bindgen_1f6a4a088740d7bc (
--   T arg1
-- )
-- {
--   (foo)(arg1);
-- }
-- void hs_bindgen_69080a62615bc0d8 (
--   T arg1
-- )
-- {
--   (bar)(arg1);
-- }
-- /* test_macrosredeclarationidentical_Example_get_foo */
-- __attribute__ ((const))
-- void (*hs_bindgen_a17f85783f80f294 (void)) (
--   T arg1
-- )
-- {
--   return &foo;
-- }
-- /* test_macrosredeclarationidentical_Example_get_bar */
-- __attribute__ ((const))
-- void (*hs_bindgen_fbbde3e7da8ad667 (void)) (
--   T arg1
-- )
-- {
--   return &bar;
-- }
{-| __C declaration:__ @macro T@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 2:9@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
newtype T
    = T {unwrapT :: CInt}
    deriving stock (Eq, Generic, Ord, Read, Show)
    deriving newtype (Bitfield,
                      Bits,
                      Bounded,
                      Enum,
                      FiniteBits,
                      HasFFIType,
                      Integral,
                      Ix,
                      Num,
                      Prim,
                      ReadRaw,
                      Real,
                      StaticSize,
                      Storable,
                      WriteRaw)
instance (~) ty CInt => HasField "unwrapT" T ty
    where hasField = \x_0 -> (\y_1 -> T{unwrapT = y_1},
                              getField @"unwrapT" x_0)
instance (~) ty CInt => HasField "unwrapT" (Ptr T) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapT")
instance HasCField T "unwrapT"
    where type CFieldType T "unwrapT" = CInt
          offset# = \_ -> \_ -> 0
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_foo@
foreign import ccall safe "hs_bindgen_3a672aa51059499f" hs_bindgen_3a672aa51059499f_base ::
    CInt
 -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_foo@
hs_bindgen_3a672aa51059499f :: T -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_foo@
hs_bindgen_3a672aa51059499f = \x_0 -> hs_bindgen_3a672aa51059499f_base (toFFIType x_0)
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_safe :: T -> IO ()
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_safe = hs_bindgen_3a672aa51059499f
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_bar@
foreign import ccall safe "hs_bindgen_f6ce0c67437e90e7" hs_bindgen_f6ce0c67437e90e7_base ::
    CInt
 -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_bar@
hs_bindgen_f6ce0c67437e90e7 :: T -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Safe_bar@
hs_bindgen_f6ce0c67437e90e7 = \x_0 -> hs_bindgen_f6ce0c67437e90e7_base (toFFIType x_0)
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_safe :: T -> IO ()
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_safe = hs_bindgen_f6ce0c67437e90e7
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_foo@
foreign import ccall unsafe "hs_bindgen_1f6a4a088740d7bc" hs_bindgen_1f6a4a088740d7bc_base ::
    CInt
 -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_foo@
hs_bindgen_1f6a4a088740d7bc :: T -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_foo@
hs_bindgen_1f6a4a088740d7bc = \x_0 -> hs_bindgen_1f6a4a088740d7bc_base (toFFIType x_0)
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_unsafe :: T -> IO ()
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_unsafe = hs_bindgen_1f6a4a088740d7bc
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_bar@
foreign import ccall unsafe "hs_bindgen_69080a62615bc0d8" hs_bindgen_69080a62615bc0d8_base ::
    CInt
 -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_bar@
hs_bindgen_69080a62615bc0d8 :: T -> IO ()
-- __unique:__ @test_macrosredeclarationidentical_Example_Unsafe_bar@
hs_bindgen_69080a62615bc0d8 = \x_0 -> hs_bindgen_69080a62615bc0d8_base (toFFIType x_0)
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_unsafe :: T -> IO ()
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_unsafe = hs_bindgen_69080a62615bc0d8
-- __unique:__ @test_macrosredeclarationidentical_Example_get_foo@
foreign import ccall unsafe "hs_bindgen_a17f85783f80f294" hs_bindgen_a17f85783f80f294_base ::
    IO (FunPtr Void)
-- __unique:__ @test_macrosredeclarationidentical_Example_get_foo@
hs_bindgen_a17f85783f80f294 :: IO (FunPtr (T -> IO ()))
-- __unique:__ @test_macrosredeclarationidentical_Example_get_foo@
hs_bindgen_a17f85783f80f294 = fmap fromFFIType hs_bindgen_a17f85783f80f294_base
{-# NOINLINE foo_funptr #-}
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_funptr :: FunPtr (T -> IO ())
{-| __C declaration:__ @foo@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 3:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
foo_funptr = unsafePerformIO hs_bindgen_a17f85783f80f294
-- __unique:__ @test_macrosredeclarationidentical_Example_get_bar@
foreign import ccall unsafe "hs_bindgen_fbbde3e7da8ad667" hs_bindgen_fbbde3e7da8ad667_base ::
    IO (FunPtr Void)
-- __unique:__ @test_macrosredeclarationidentical_Example_get_bar@
hs_bindgen_fbbde3e7da8ad667 :: IO (FunPtr (T -> IO ()))
-- __unique:__ @test_macrosredeclarationidentical_Example_get_bar@
hs_bindgen_fbbde3e7da8ad667 = fmap fromFFIType hs_bindgen_fbbde3e7da8ad667_base
{-# NOINLINE bar_funptr #-}
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_funptr :: FunPtr (T -> IO ())
{-| __C declaration:__ @bar@

    __defined at:__ @macros\/redeclaration\/identical_semantics.h 5:6@

    __exported by:__ @macros\/redeclaration\/identical_semantics.h@
-}
bar_funptr = unsafePerformIO hs_bindgen_fbbde3e7da8ad667