{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}
module SDL3.Sys.Bindgen.Bits.Safe (
SDL3.Sys.Bindgen.Bits.Safe.sDL_MostSignificantBitIndex32,
SDL3.Sys.Bindgen.Bits.Safe.sDL_HasExactlyOneBitSet32,
)
where
import Prelude (IO, fmap)
import HsBindgen.Runtime.LibC qualified
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Stdinc 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/SDL_bits.h>"
, "signed int hs_bindgen_456d262a9d645a2c ("
, " Uint32 arg1"
, ")"
, "{"
, " return (SDL_MostSignificantBitIndex32)(arg1);"
, "}"
, "_Bool hs_bindgen_f02b1182f4d7fd03 ("
, " Uint32 arg1"
, ")"
, "{"
, " return (SDL_HasExactlyOneBitSet32)(arg1);"
, "}"
]
)
)
foreign import ccall safe "hs_bindgen_456d262a9d645a2c"
hs_bindgen_456d262a9d645a2c_base
:: HsBindgen.Runtime.LibC.Word32
-> IO BG.CInt
hs_bindgen_456d262a9d645a2c
:: SDL3.Sys.Bindgen.Stdinc.Uint32
-> IO BG.CInt
hs_bindgen_456d262a9d645a2c :: Uint32 -> IO CInt
hs_bindgen_456d262a9d645a2c =
\Uint32
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 (Word32 -> IO CInt
hs_bindgen_456d262a9d645a2c_base (Uint32 -> FFIType Uint32
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Uint32
x0))
sDL_MostSignificantBitIndex32
:: SDL3.Sys.Bindgen.Stdinc.Uint32
-> IO BG.CInt
sDL_MostSignificantBitIndex32 :: Uint32 -> IO CInt
sDL_MostSignificantBitIndex32 =
Uint32 -> IO CInt
hs_bindgen_456d262a9d645a2c
foreign import ccall safe "hs_bindgen_f02b1182f4d7fd03"
hs_bindgen_f02b1182f4d7fd03_base
:: HsBindgen.Runtime.LibC.Word32
-> IO BG.CBool
hs_bindgen_f02b1182f4d7fd03
:: SDL3.Sys.Bindgen.Stdinc.Uint32
-> IO BG.CBool
hs_bindgen_f02b1182f4d7fd03 :: Uint32 -> IO CBool
hs_bindgen_f02b1182f4d7fd03 =
\Uint32
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 (Word32 -> IO CBool
hs_bindgen_f02b1182f4d7fd03_base (Uint32 -> FFIType Uint32
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Uint32
x0))
sDL_HasExactlyOneBitSet32
:: SDL3.Sys.Bindgen.Stdinc.Uint32
-> IO BG.CBool
sDL_HasExactlyOneBitSet32 :: Uint32 -> IO CBool
sDL_HasExactlyOneBitSet32 =
Uint32 -> IO CBool
hs_bindgen_f02b1182f4d7fd03