From a384c08466d343033b390d07c416414745a5adb6 Mon Sep 17 00:00:00 2001 From: andromeda Date: Tue, 18 Aug 2026 14:44:09 +0200 Subject: fix comptime errors --- Main.hs | 4 ++-- RGFW.hs | 3 ++- shim.c | 1 - vktest.cabal | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Main.hs b/Main.hs index 55ada37..1a81830 100644 --- a/Main.hs +++ b/Main.hs @@ -13,7 +13,7 @@ import Foreign.C import Foreign.C.ConstPtr (ConstPtr(..)) import Foreign.Marshal.Alloc (alloca) import Foreign.Marshal.Array (advancePtr) -import Foreign.Ptr (Ptr) +import Foreign.Ptr (Ptr, nullPtr) import Foreign.Storable (peek) import qualified RGFW as RGFW import qualified Vulkan.Core10 as Vk @@ -37,7 +37,7 @@ main = withRGFW "rgfw instance title" 0 $ \_ -> do Vk.withInstance (zero {Vk.enabledExtensionNames = exts}) Nothing bracket $ \i -> do putStrLn $ show i withWindow "test window" 0 0 width height ((fromIntegral (RGFW.unwrapRGFW_windowFlags_enum RGFW.RGFW_windowCenter)) .|. (fromIntegral (RGFW.unwrapRGFW_windowFlags_enum RGFW.RGFW_windowNoResize))) $ \window -> do - res <- RGFW.rGFW_window_createSurface_Vulkan window i nullPtr + res <- RGFW.rGFW_window_createSurface_Vulkan window (coerce $ Vk.instanceHandle i) nullPtr ret <- gameloop window 0 putStr "gameloop returned with code: " putStrLn $ show ret diff --git a/RGFW.hs b/RGFW.hs index 4104993..29a5c5f 100644 --- a/RGFW.hs +++ b/RGFW.hs @@ -27,7 +27,8 @@ import HsBindgen.TH let conf = def{ clang = def{ extraIncludeDirs = [Dir "include"], - defineMacros = [ "RGFW_VULKAN=" ]}} + defineMacros = [ "RGFW_VULKAN=" ]}, + programSlicing = EnableProgramSlicing} confTH = def{verbosity = Verbosity Warning} in withHsBindgen conf confTH $ hashInclude "RGFW.h" \ No newline at end of file diff --git a/shim.c b/shim.c index ae12168..d944f24 100644 --- a/shim.c +++ b/shim.c @@ -1,3 +1,2 @@ #define RGFW_IMPLEMENTATION -#define RGFW_VULKAN #include diff --git a/vktest.cabal b/vktest.cabal index 0447db0..95d8ec5 100644 --- a/vktest.cabal +++ b/vktest.cabal @@ -28,5 +28,5 @@ executable vktest include-dirs: include hs-source-dirs: . c-sources: shim.c - ghc-options: -Wall + ghc-options: -Wall -optc-DRGFW_VULKAN default-language: Haskell2010 \ No newline at end of file -- cgit v1.3.1