-- addDependentFile examples/golden/macros/macro_typedef_struct.h
{-| __C declaration:__ @MY_TYPE@

    __defined at:__ @macros\/macro_typedef_struct.h 1:9@

    __exported by:__ @macros\/macro_typedef_struct.h@
-}
newtype MY_TYPE
    = MY_TYPE {unwrapMY_TYPE :: CInt}
      {- ^ __C declaration:__ @MY_TYPE@

           __defined at:__ @macros\/macro_typedef_struct.h 1:9@

           __exported by:__ @macros\/macro_typedef_struct.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 MY_TYPE "unwrapMY_TYPE") =>
         HasField "unwrapMY_TYPE" (Ptr MY_TYPE) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapMY_TYPE")
instance HasCField MY_TYPE "unwrapMY_TYPE"
    where type CFieldType MY_TYPE "unwrapMY_TYPE" = CInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @struct bar@

    __defined at:__ @macros\/macro_typedef_struct.h 3:9@

    __exported by:__ @macros\/macro_typedef_struct.h@
-}
data Bar
    = Bar {bar_x :: CInt
           {- ^ __C declaration:__ @x@

                __defined at:__ @macros\/macro_typedef_struct.h 4:7@

                __exported by:__ @macros\/macro_typedef_struct.h@
           -},
           bar_y :: MY_TYPE
           {- ^ __C declaration:__ @y@

                __defined at:__ @macros\/macro_typedef_struct.h 5:11@

                __exported by:__ @macros\/macro_typedef_struct.h@
           -}}
      {- ^ __C declaration:__ @struct bar@

           __defined at:__ @macros\/macro_typedef_struct.h 3:9@

           __exported by:__ @macros\/macro_typedef_struct.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Bar
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Bar
    where readRaw = \ptr_0 -> (pure Bar <*> readRaw (Proxy @"bar_x") ptr_0) <*> readRaw (Proxy @"bar_y") ptr_0
instance WriteRaw Bar
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Bar bar_x_2
                                           bar_y_3 -> writeRaw (Proxy @"bar_x") ptr_0 bar_x_2 >> writeRaw (Proxy @"bar_y") ptr_0 bar_y_3
deriving via (EquivStorable Bar) instance Storable Bar
instance HasCField Bar "bar_x"
    where type CFieldType Bar "bar_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Bar "bar_x") =>
         HasField "bar_x" (Ptr Bar) (Ptr ty)
    where getField = fromPtr (Proxy @"bar_x")
instance HasCField Bar "bar_y"
    where type CFieldType Bar "bar_y" = MY_TYPE
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType Bar "bar_y") =>
         HasField "bar_y" (Ptr Bar) (Ptr ty)
    where getField = fromPtr (Proxy @"bar_y")
