{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}
module SDL3.Sys.Bindgen.Pen.FunPtr (
SDL3.Sys.Bindgen.Pen.FunPtr.sDL_GetPenDeviceType,
)
where
import Prelude (IO, fmap)
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Pen
$( 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/SDL_pen.h>"
, "#include <SDL3/SDL_version.h>"
, "#include <SDL3/SDL_error.h>"
, "#include <SDL3/SDL_version.h>"
, "#if !SDL_VERSION_ATLEAST(3, 4, 0)"
, "typedef int SDL_PenDeviceType;"
, "#endif"
, "/* sdl3bindgensys_SDL3.Sys.Bindgen.Pen_get_SDL_GetPenDeviceType */"
, "__attribute__ ((const))"
, "SDL_PenDeviceType (*hs_bindgen_bcd57304ca37ccf0 (void)) ("
, " SDL_PenID arg1"
, ")"
, "{"
, "#if SDL_VERSION_ATLEAST(3, 4, 0)"
, " return &SDL_GetPenDeviceType;"
, "#else"
, " SDL_SetError(\"SDL_GetPenDeviceType requires SDL >= 3.4.0\"); return 0;"
, "#endif"
, "}"
]
)
)
foreign import ccall unsafe "hs_bindgen_bcd57304ca37ccf0"
hs_bindgen_bcd57304ca37ccf0_base
:: IO (BG.FunPtr BG.Void)
hs_bindgen_bcd57304ca37ccf0 :: IO (BG.FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
hs_bindgen_bcd57304ca37ccf0 :: IO (FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
hs_bindgen_bcd57304ca37ccf0 =
(FunPtr Void -> FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
-> IO (FunPtr Void)
-> IO (FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap FunPtr Void -> FunPtr (SDL_PenID -> IO SDL_PenDeviceType)
FFIType (FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
-> FunPtr (SDL_PenID -> IO SDL_PenDeviceType)
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType IO (FunPtr Void)
hs_bindgen_bcd57304ca37ccf0_base
{-# NOINLINE sDL_GetPenDeviceType #-}
sDL_GetPenDeviceType :: BG.FunPtr (SDL_PenID -> IO SDL_PenDeviceType)
sDL_GetPenDeviceType :: FunPtr (SDL_PenID -> IO SDL_PenDeviceType)
sDL_GetPenDeviceType =
IO (FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
-> FunPtr (SDL_PenID -> IO SDL_PenDeviceType)
forall a. IO a -> a
BG.unsafePerformIO IO (FunPtr (SDL_PenID -> IO SDL_PenDeviceType))
hs_bindgen_bcd57304ca37ccf0