From a8f69bec0666b624a45df95849b65e02e5e25474 Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Fri, 23 Jan 2026 13:10:34 +0000 Subject: [PATCH] disambiguate exports (rename 'export.h' to 'glfw-export.h' because now we are beginning to add RGFW as a back-end with its own separate exports) --- build-unix-debug.sh | 2 +- build-unix.sh | 2 +- ffi/{export.h => glfw-export.h} | 25 ++++++++++++++----------- ffi/glfw-input.c | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) rename ffi/{export.h => glfw-export.h} (88%) diff --git a/build-unix-debug.sh b/build-unix-debug.sh index 9ddbd60..1f4ddd0 100755 --- a/build-unix-debug.sh +++ b/build-unix-debug.sh @@ -1,6 +1,6 @@ #!/bin/sh mlton -const 'Exn.keepHistory true' -link-opt "$(pkg-config --cflags glfw3) $(pkg-config --static --libs glfw3)" \ - -export-header ffi/export.h \ + -export-header ffi/glfw-export.h \ shf.mlb \ ffi/glad.c \ ffi/glfw-export.c \ diff --git a/build-unix.sh b/build-unix.sh index ca4f7bd..e6f153e 100755 --- a/build-unix.sh +++ b/build-unix.sh @@ -1,6 +1,6 @@ #!/bin/sh mlton -link-opt "$(pkg-config --cflags glfw3) $(pkg-config --static --libs glfw3)" \ - -export-header ffi/export.h \ + -export-header ffi/glfw-export.h \ shf.mlb \ ffi/glad.c \ ffi/glfw-export.c \ diff --git a/ffi/export.h b/ffi/glfw-export.h similarity index 88% rename from ffi/export.h rename to ffi/glfw-export.h index d896f08..f09f8a4 100644 --- a/ffi/export.h +++ b/ffi/glfw-export.h @@ -1,5 +1,5 @@ -#ifndef __SHF_RGFW_ML_H__ -#define __SHF_RGFW_ML_H__ +#ifndef __SHF_ML_H__ +#define __SHF_ML_H__ /* Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh * Jagannathan, and Stephen Weeks. @@ -132,23 +132,23 @@ typedef Pointer Objptr; #endif /* _MLTON_EXPORT_H_ */ -#if !defined(PART_OF_SHF_RGFW) && \ - !defined(STATIC_LINK_SHF_RGFW) && \ - !defined(DYNAMIC_LINK_SHF_RGFW) -#define PART_OF_SHF_RGFW +#if !defined(PART_OF_SHF) && \ + !defined(STATIC_LINK_SHF) && \ + !defined(DYNAMIC_LINK_SHF) +#define PART_OF_SHF #endif -#if defined(PART_OF_SHF_RGFW) +#if defined(PART_OF_SHF) #define MLLIB_PRIVATE(x) PRIVATE x #define MLLIB_PUBLIC(x) PUBLIC x -#elif defined(STATIC_LINK_SHF_RGFW) +#elif defined(STATIC_LINK_SHF) #define MLLIB_PRIVATE(x) #define MLLIB_PUBLIC(x) PUBLIC x -#elif defined(DYNAMIC_LINK_SHF_RGFW) +#elif defined(DYNAMIC_LINK_SHF) #define MLLIB_PRIVATE(x) #define MLLIB_PUBLIC(x) EXTERNAL x #else -#error Must specify linkage for shf_rgfw +#error Must specify linkage for shf #define MLLIB_PRIVATE(x) #define MLLIB_PUBLIC(x) #endif @@ -157,6 +157,9 @@ typedef Pointer Objptr; extern "C" { #endif +MLLIB_PUBLIC(void mltonFramebufferSizeCallback (Int32 x0, Int32 x1);) +MLLIB_PUBLIC(void mltonCharCallback (Word32 x0);) +MLLIB_PUBLIC(void mltonKeyCallback (Int32 x0, Int32 x1, Int32 x2, Int32 x3);) #undef MLLIB_PRIVATE #undef MLLIB_PUBLIC @@ -165,4 +168,4 @@ extern "C" { } #endif -#endif /* __SHF_RGFW_ML_H__ */ +#endif /* __SHF_ML_H__ */ diff --git a/ffi/glfw-input.c b/ffi/glfw-input.c index 689a64d..9f824ac 100644 --- a/ffi/glfw-input.c +++ b/ffi/glfw-input.c @@ -1,4 +1,4 @@ -#include "export.h" +#include "glfw-export.h" #include "glad.h" #define GLFW_INCLUDE_NONE #include