{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}
module SDL3.Sys.Bindgen.AtomicShims.Unsafe (
SDL3.Sys.Bindgen.AtomicShims.Unsafe.lithon_SDL_AtomicIncRef,
SDL3.Sys.Bindgen.AtomicShims.Unsafe.lithon_SDL_AtomicDecRef,
)
where
import Prelude (IO, fmap)
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Atomic qualified
$( HsBindgen.Runtime.Support.CAPI.addCSource
( HsBindgen.Runtime.Support.CAPI.unlines
[ "#define SDL_MAIN_HANDLED"
, "#define SDL_SLOW_MEMCPY"
, "#define SDL_SLOW_MEMMOVE"
, "#define SDL_SLOW_MEMSET"
, "#include <sdl3-bindgen-sys/SDL_atomic_shims.h>"
, "signed int hs_bindgen_2bbc525ff65f8e15 ("
, " SDL_AtomicInt *arg1"
, ")"
, "{"
, " return (lithon_SDL_AtomicIncRef)(arg1);"
, "}"
, "_Bool hs_bindgen_848dcd1814dd10a0 ("
, " SDL_AtomicInt *arg1"
, ")"
, "{"
, " return (lithon_SDL_AtomicDecRef)(arg1);"
, "}"
]
)
)
foreign import ccall unsafe "hs_bindgen_2bbc525ff65f8e15"
hs_bindgen_2bbc525ff65f8e15_base
:: BG.Ptr BG.Void
-> IO BG.CInt
hs_bindgen_2bbc525ff65f8e15
:: BG.Ptr SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt
-> IO BG.CInt
hs_bindgen_2bbc525ff65f8e15 :: Ptr SDL_AtomicInt -> IO CInt
hs_bindgen_2bbc525ff65f8e15 =
\Ptr SDL_AtomicInt
x0 ->
(CInt -> CInt) -> IO CInt -> IO CInt
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> CInt
FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType (Ptr Void -> IO CInt
hs_bindgen_2bbc525ff65f8e15_base (Ptr SDL_AtomicInt -> FFIType (Ptr SDL_AtomicInt)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr SDL_AtomicInt
x0))
lithon_SDL_AtomicIncRef
:: BG.Ptr SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt
-> IO BG.CInt
lithon_SDL_AtomicIncRef :: Ptr SDL_AtomicInt -> IO CInt
lithon_SDL_AtomicIncRef = Ptr SDL_AtomicInt -> IO CInt
hs_bindgen_2bbc525ff65f8e15
foreign import ccall unsafe "hs_bindgen_848dcd1814dd10a0"
hs_bindgen_848dcd1814dd10a0_base
:: BG.Ptr BG.Void
-> IO BG.CBool
hs_bindgen_848dcd1814dd10a0
:: BG.Ptr SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt
-> IO BG.CBool
hs_bindgen_848dcd1814dd10a0 :: Ptr SDL_AtomicInt -> IO CBool
hs_bindgen_848dcd1814dd10a0 =
\Ptr SDL_AtomicInt
x0 ->
(CBool -> CBool) -> IO CBool -> IO CBool
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CBool -> CBool
FFIType CBool -> CBool
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType (Ptr Void -> IO CBool
hs_bindgen_848dcd1814dd10a0_base (Ptr SDL_AtomicInt -> FFIType (Ptr SDL_AtomicInt)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr SDL_AtomicInt
x0))
lithon_SDL_AtomicDecRef
:: BG.Ptr SDL3.Sys.Bindgen.Atomic.SDL_AtomicInt
-> IO BG.CBool
lithon_SDL_AtomicDecRef :: Ptr SDL_AtomicInt -> IO CBool
lithon_SDL_AtomicDecRef = Ptr SDL_AtomicInt -> IO CBool
hs_bindgen_848dcd1814dd10a0