packages feed

hs-bindgen-1.0.0.0: test-artefacts/fixtures/binding-specs/enum/mismatch/th.txt

-- addDependentFile test-artefacts/headers/golden/binding-specs/enum/mismatch.h
{-| __C declaration:__ @struct pt@

    __defined at:__ @binding-specs\/enum\/mismatch.h 1:8@

    __exported by:__ @binding-specs\/enum\/mismatch.h@
-}
data Pt
    = Pt {pt_x :: CDouble
          {- ^ __C declaration:__ @x@

               __defined at:__ @binding-specs\/enum\/mismatch.h 1:20@

               __exported by:__ @binding-specs\/enum\/mismatch.h@
          -},
          pt_y :: CDouble
          {- ^ __C declaration:__ @y@

               __defined at:__ @binding-specs\/enum\/mismatch.h 1:23@

               __exported by:__ @binding-specs\/enum\/mismatch.h@
          -}}
    deriving stock (Eq, Generic, Show)
instance StaticSize Pt
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw Pt
    where readRaw = \ptr_0 -> (pure Pt <*> readRaw (Proxy @"pt_x") ptr_0) <*> readRaw (Proxy @"pt_y") ptr_0
instance WriteRaw Pt
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Pt pt_x_2
                                          pt_y_3 -> writeRaw (Proxy @"pt_x") ptr_0 pt_x_2 >> writeRaw (Proxy @"pt_y") ptr_0 pt_y_3
deriving via (EquivStorable Pt) instance Storable Pt
deriving via (IsStructViaReadRaw Pt) instance IsStruct Pt
instance (~) ty CDouble => HasField "pt_x" Pt ty
    where hasField = \x_0 -> (\y_1 -> Pt{pt_x = y_1,
                                         pt_y = getField @"pt_y" x_0},
                              getField @"pt_x" x_0)
instance (~) ty CDouble => HasField "pt_x" (Ptr Pt) (Ptr ty)
    where getField = fromPtr (Proxy @"pt_x")
instance HasCField Pt "pt_x"
    where type CFieldType Pt "pt_x" = CDouble
          offset# = \_ -> \_ -> 0
instance (~) ty CDouble => HasField "pt_y" Pt ty
    where hasField = \x_0 -> (\y_1 -> Pt{pt_y = y_1,
                                         pt_x = getField @"pt_x" x_0},
                              getField @"pt_y" x_0)
instance (~) ty CDouble => HasField "pt_y" (Ptr Pt) (Ptr ty)
    where getField = fromPtr (Proxy @"pt_y")
instance HasCField Pt "pt_y"
    where type CFieldType Pt "pt_y" = CDouble
          offset# = \_ -> \_ -> 8