From: Mike Pall Date: Sun, 16 Nov 2025 18:41:51 +0000 (+0100) Subject: ELF/Mach-O: Force default visibility for public API functions. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e17ee83326f73d2bbfce5750ae8dc592a3b63c27;p=thirdparty%2FLuaJIT.git ELF/Mach-O: Force default visibility for public API functions. Thanks to Dymphna. #1409 --- diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua index e4ca1977..5a55789a 100644 --- a/src/jit/bcsave.lua +++ b/src/jit/bcsave.lua @@ -165,6 +165,8 @@ extern "C" #endif #ifdef _WIN32 __declspec(dllexport) +#elif (defined(__ELF__) || defined(__MACH__) || defined(__psp2__)) && !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__)) +__attribute__((visibility("default"))) #endif const unsigned char %s%s[] = { ]], LJBC_PREFIX, ctx.modname)) diff --git a/src/luaconf.h b/src/luaconf.h index 7cd2edb5..6959313d 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -132,6 +132,8 @@ #else #define LUA_API __declspec(dllimport) #endif +#elif (defined(__ELF__) || defined(__MACH__) || defined(__psp2__)) && !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__)) +#define LUA_API extern __attribute__((visibility("default"))) #else #define LUA_API extern #endif