Only expose public functions in GNU compiler builds if SM64_LIB_EXPORT is defined.

This is useful for WebAssembly builds, since `libsm64` is built as a static library and the final linked `.wasm` file might not want to expose the `libsm64` functions.
This commit is contained in:
Renato Rotenberg
2025-01-28 22:57:13 -03:00
parent 9fd54c8c5b
commit c1b11da985
+4
View File
@@ -12,7 +12,11 @@
#define SM64_LIB_FN __declspec(dllimport) #define SM64_LIB_FN __declspec(dllimport)
#endif #endif
#elif defined(__GNUC__) && __GNUC__ >= 4 #elif defined(__GNUC__) && __GNUC__ >= 4
#ifdef SM64_LIB_EXPORT
#define SM64_LIB_FN __attribute__ ((visibility("default"))) #define SM64_LIB_FN __attribute__ ((visibility("default")))
#else
#define SM64_LIB_FN
#endif
#else #else
#define SM64_LIB_FN #define SM64_LIB_FN
#endif #endif