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)

This commit is contained in:
2026-01-23 13:10:34 +00:00
parent e18032dcc8
commit a8f69bec06
4 changed files with 17 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
mlton -const 'Exn.keepHistory true' -link-opt "$(pkg-config --cflags glfw3) $(pkg-config --static --libs glfw3)" \ 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 \ shf.mlb \
ffi/glad.c \ ffi/glad.c \
ffi/glfw-export.c \ ffi/glfw-export.c \

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
mlton -link-opt "$(pkg-config --cflags glfw3) $(pkg-config --static --libs glfw3)" \ 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 \ shf.mlb \
ffi/glad.c \ ffi/glad.c \
ffi/glfw-export.c \ ffi/glfw-export.c \

View File

@@ -1,5 +1,5 @@
#ifndef __SHF_RGFW_ML_H__ #ifndef __SHF_ML_H__
#define __SHF_RGFW_ML_H__ #define __SHF_ML_H__
/* Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh /* Copyright (C) 2004-2007 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks. * Jagannathan, and Stephen Weeks.
@@ -132,23 +132,23 @@ typedef Pointer Objptr;
#endif /* _MLTON_EXPORT_H_ */ #endif /* _MLTON_EXPORT_H_ */
#if !defined(PART_OF_SHF_RGFW) && \ #if !defined(PART_OF_SHF) && \
!defined(STATIC_LINK_SHF_RGFW) && \ !defined(STATIC_LINK_SHF) && \
!defined(DYNAMIC_LINK_SHF_RGFW) !defined(DYNAMIC_LINK_SHF)
#define PART_OF_SHF_RGFW #define PART_OF_SHF
#endif #endif
#if defined(PART_OF_SHF_RGFW) #if defined(PART_OF_SHF)
#define MLLIB_PRIVATE(x) PRIVATE x #define MLLIB_PRIVATE(x) PRIVATE x
#define MLLIB_PUBLIC(x) PUBLIC x #define MLLIB_PUBLIC(x) PUBLIC x
#elif defined(STATIC_LINK_SHF_RGFW) #elif defined(STATIC_LINK_SHF)
#define MLLIB_PRIVATE(x) #define MLLIB_PRIVATE(x)
#define MLLIB_PUBLIC(x) PUBLIC x #define MLLIB_PUBLIC(x) PUBLIC x
#elif defined(DYNAMIC_LINK_SHF_RGFW) #elif defined(DYNAMIC_LINK_SHF)
#define MLLIB_PRIVATE(x) #define MLLIB_PRIVATE(x)
#define MLLIB_PUBLIC(x) EXTERNAL x #define MLLIB_PUBLIC(x) EXTERNAL x
#else #else
#error Must specify linkage for shf_rgfw #error Must specify linkage for shf
#define MLLIB_PRIVATE(x) #define MLLIB_PRIVATE(x)
#define MLLIB_PUBLIC(x) #define MLLIB_PUBLIC(x)
#endif #endif
@@ -157,6 +157,9 @@ typedef Pointer Objptr;
extern "C" { extern "C" {
#endif #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_PRIVATE
#undef MLLIB_PUBLIC #undef MLLIB_PUBLIC
@@ -165,4 +168,4 @@ extern "C" {
} }
#endif #endif
#endif /* __SHF_RGFW_ML_H__ */ #endif /* __SHF_ML_H__ */

View File

@@ -1,4 +1,4 @@
#include "export.h" #include "glfw-export.h"
#include "glad.h" #include "glad.h"
#define GLFW_INCLUDE_NONE #define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>