{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}
module SDL3.Sys.Bindgen.ThreadShims.Safe (
SDL3.Sys.Bindgen.ThreadShims.Safe.lithon_SDL_CreateThread,
SDL3.Sys.Bindgen.ThreadShims.Safe.lithon_SDL_CreateThreadWithProperties,
)
where
import Prelude (IO, fmap)
import HsBindgen.Runtime.LibC qualified
import HsBindgen.Runtime.PtrConst qualified as PtrConst
import HsBindgen.Runtime.Support qualified
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Properties qualified
import SDL3.Sys.Bindgen.Thread 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_thread_shims.h>"
, "SDL_Thread *hs_bindgen_e84ec697d5dd22d2 ("
, " SDL_ThreadFunction arg1,"
, " char const *arg2,"
, " void *arg3"
, ")"
, "{"
, " return (lithon_SDL_CreateThread)(arg1, arg2, arg3);"
, "}"
, "SDL_Thread *hs_bindgen_860c725a5e87fb2b ("
, " SDL_PropertiesID arg1"
, ")"
, "{"
, " return (lithon_SDL_CreateThreadWithProperties)(arg1);"
, "}"
]
)
)
foreign import ccall safe "hs_bindgen_e84ec697d5dd22d2"
hs_bindgen_e84ec697d5dd22d2_base
:: HsBindgen.Runtime.Support.FunPtrVoid
-> BG.Ptr BG.Void
-> BG.Ptr BG.Void
-> IO (BG.Ptr BG.Void)
hs_bindgen_e84ec697d5dd22d2
:: SDL3.Sys.Bindgen.Thread.SDL_ThreadFunction
-> PtrConst.PtrConst BG.CChar
-> BG.Ptr BG.Void
-> IO (BG.Ptr SDL3.Sys.Bindgen.Thread.SDL_Thread)
hs_bindgen_e84ec697d5dd22d2 :: SDL_ThreadFunction
-> PtrConst CChar -> Ptr Void -> IO (Ptr SDL_Thread)
hs_bindgen_e84ec697d5dd22d2 =
\SDL_ThreadFunction
x0 ->
\PtrConst CChar
x1 ->
\Ptr Void
x2 ->
(Ptr Void -> Ptr SDL_Thread)
-> IO (Ptr Void) -> IO (Ptr SDL_Thread)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
Ptr Void -> Ptr SDL_Thread
FFIType (Ptr SDL_Thread) -> Ptr SDL_Thread
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType
(FunPtrVoid -> Ptr Void -> Ptr Void -> IO (Ptr Void)
hs_bindgen_e84ec697d5dd22d2_base (SDL_ThreadFunction -> FFIType SDL_ThreadFunction
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType SDL_ThreadFunction
x0) (PtrConst CChar -> FFIType (PtrConst CChar)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType PtrConst CChar
x1) (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x2))
lithon_SDL_CreateThread
:: SDL3.Sys.Bindgen.Thread.SDL_ThreadFunction
-> PtrConst.PtrConst BG.CChar
-> BG.Ptr BG.Void
-> IO (BG.Ptr SDL3.Sys.Bindgen.Thread.SDL_Thread)
lithon_SDL_CreateThread :: SDL_ThreadFunction
-> PtrConst CChar -> Ptr Void -> IO (Ptr SDL_Thread)
lithon_SDL_CreateThread = SDL_ThreadFunction
-> PtrConst CChar -> Ptr Void -> IO (Ptr SDL_Thread)
hs_bindgen_e84ec697d5dd22d2
foreign import ccall safe "hs_bindgen_860c725a5e87fb2b"
hs_bindgen_860c725a5e87fb2b_base
:: HsBindgen.Runtime.LibC.Word32
-> IO (BG.Ptr BG.Void)
hs_bindgen_860c725a5e87fb2b
:: SDL3.Sys.Bindgen.Properties.SDL_PropertiesID
-> IO (BG.Ptr SDL3.Sys.Bindgen.Thread.SDL_Thread)
hs_bindgen_860c725a5e87fb2b :: SDL_PropertiesID -> IO (Ptr SDL_Thread)
hs_bindgen_860c725a5e87fb2b =
\SDL_PropertiesID
x0 ->
(Ptr Void -> Ptr SDL_Thread)
-> IO (Ptr Void) -> IO (Ptr SDL_Thread)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr Void -> Ptr SDL_Thread
FFIType (Ptr SDL_Thread) -> Ptr SDL_Thread
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType (Word32 -> IO (Ptr Void)
hs_bindgen_860c725a5e87fb2b_base (SDL_PropertiesID -> FFIType SDL_PropertiesID
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType SDL_PropertiesID
x0))
lithon_SDL_CreateThreadWithProperties
:: SDL3.Sys.Bindgen.Properties.SDL_PropertiesID
-> IO (BG.Ptr SDL3.Sys.Bindgen.Thread.SDL_Thread)
lithon_SDL_CreateThreadWithProperties :: SDL_PropertiesID -> IO (Ptr SDL_Thread)
lithon_SDL_CreateThreadWithProperties =
SDL_PropertiesID -> IO (Ptr SDL_Thread)
hs_bindgen_860c725a5e87fb2b