-- addDependentFile examples/golden/declarations/redeclaration.h -- #include -- /* test_declarationsredeclaration_Example_get_x */ -- __attribute__ ((const)) -- signed int *hs_bindgen_6f47e5cbb92690b9 (void) -- { -- return &x; -- } {-| __C declaration:__ @int_t@ __defined at:__ @declarations\/redeclaration.h 20:13@ __exported by:__ @declarations\/redeclaration.h@ -} newtype Int_t = Int_t {unwrapInt_t :: CInt} {- ^ __C declaration:__ @int_t@ __defined at:__ @declarations\/redeclaration.h 20:13@ __exported by:__ @declarations\/redeclaration.h@ -} deriving stock (Eq, Ord, Read, Show) deriving newtype (StaticSize, ReadRaw, WriteRaw, Storable, HasFFIType, Prim, Bitfield, Bits, Bounded, Enum, FiniteBits, Integral, Ix, Num, Real) instance TyEq ty (CFieldType Int_t "unwrapInt_t") => HasField "unwrapInt_t" (Ptr Int_t) (Ptr ty) where getField = fromPtr (Proxy @"unwrapInt_t") instance HasCField Int_t "unwrapInt_t" where type CFieldType Int_t "unwrapInt_t" = CInt offset# = \_ -> \_ -> 0 {-| __C declaration:__ @struct X@ __defined at:__ @declarations\/redeclaration.h 26:8@ __exported by:__ @declarations\/redeclaration.h@ -} data X = X {x_n :: CInt {- ^ __C declaration:__ @n@ __defined at:__ @declarations\/redeclaration.h 26:16@ __exported by:__ @declarations\/redeclaration.h@ -}} {- ^ __C declaration:__ @struct X@ __defined at:__ @declarations\/redeclaration.h 26:8@ __exported by:__ @declarations\/redeclaration.h@ -} deriving stock (Eq, Show) instance StaticSize X where staticSizeOf = \_ -> 4 :: Int staticAlignment = \_ -> 4 :: Int instance ReadRaw X where readRaw = \ptr_0 -> pure X <*> readRaw (Proxy @"x_n") ptr_0 instance WriteRaw X where writeRaw = \ptr_0 -> \s_1 -> case s_1 of X x_n_2 -> writeRaw (Proxy @"x_n") ptr_0 x_n_2 deriving via (EquivStorable X) instance Storable X instance HasCField X "x_n" where type CFieldType X "x_n" = CInt offset# = \_ -> \_ -> 0 instance TyEq ty (CFieldType X "x_n") => HasField "x_n" (Ptr X) (Ptr ty) where getField = fromPtr (Proxy @"x_n") {-| __C declaration:__ @union Y@ __defined at:__ @declarations\/redeclaration.h 30:7@ __exported by:__ @declarations\/redeclaration.h@ -} newtype Y = Y {unwrapY :: ByteArray} {- ^ __C declaration:__ @union Y@ __defined at:__ @declarations\/redeclaration.h 30:7@ __exported by:__ @declarations\/redeclaration.h@ -} deriving via (SizedByteArray 4 4) instance StaticSize Y deriving via (SizedByteArray 4 4) instance ReadRaw Y deriving via (SizedByteArray 4 4) instance WriteRaw Y deriving via (EquivStorable Y) instance Storable Y {-| __See:__ 'set_y_m' __C declaration:__ @m@ __defined at:__ @declarations\/redeclaration.h 30:15@ __exported by:__ @declarations\/redeclaration.h@ -} get_y_m :: Y -> CInt {-| __See:__ 'set_y_m' __C declaration:__ @m@ __defined at:__ @declarations\/redeclaration.h 30:15@ __exported by:__ @declarations\/redeclaration.h@ -} get_y_m = getUnionPayload {-| __See:__ 'get_y_m' -} set_y_m :: CInt -> Y {-| __See:__ 'get_y_m' -} set_y_m = setUnionPayload {-| __See:__ 'set_y_o' __C declaration:__ @o@ __defined at:__ @declarations\/redeclaration.h 30:22@ __exported by:__ @declarations\/redeclaration.h@ -} get_y_o :: Y -> CInt {-| __See:__ 'set_y_o' __C declaration:__ @o@ __defined at:__ @declarations\/redeclaration.h 30:22@ __exported by:__ @declarations\/redeclaration.h@ -} get_y_o = getUnionPayload {-| __See:__ 'get_y_o' -} set_y_o :: CInt -> Y {-| __See:__ 'get_y_o' -} set_y_o = setUnionPayload instance HasCField Y "y_m" where type CFieldType Y "y_m" = CInt offset# = \_ -> \_ -> 0 instance TyEq ty (CFieldType Y "y_m") => HasField "y_m" (Ptr Y) (Ptr ty) where getField = fromPtr (Proxy @"y_m") instance HasCField Y "y_o" where type CFieldType Y "y_o" = CInt offset# = \_ -> \_ -> 0 instance TyEq ty (CFieldType Y "y_o") => HasField "y_o" (Ptr Y) (Ptr ty) where getField = fromPtr (Proxy @"y_o") -- __unique:__ @test_declarationsredeclaration_Example_get_x@ foreign import ccall unsafe "hs_bindgen_6f47e5cbb92690b9" hs_bindgen_6f47e5cbb92690b9_base :: IO (Ptr Void) -- __unique:__ @test_declarationsredeclaration_Example_get_x@ hs_bindgen_6f47e5cbb92690b9 :: IO (Ptr CInt) -- __unique:__ @test_declarationsredeclaration_Example_get_x@ hs_bindgen_6f47e5cbb92690b9 = fromFFIType hs_bindgen_6f47e5cbb92690b9_base {-# NOINLINE x #-} {-| __C declaration:__ @x@ __defined at:__ @declarations\/redeclaration.h 11:5@ __exported by:__ @declarations\/redeclaration.h@ -} x :: Ptr CInt {-| __C declaration:__ @x@ __defined at:__ @declarations\/redeclaration.h 11:5@ __exported by:__ @declarations\/redeclaration.h@ -} x = unsafePerformIO hs_bindgen_6f47e5cbb92690b9