aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2025-11-16 19:41:51 +0100
committerMike Pall <mike>2025-11-16 19:41:51 +0100
commite17ee83326f73d2bbfce5750ae8dc592a3b63c27 (patch)
treebcce1b3ee6f1637c6e76b80138930113bceffa26
parente274fe760d46c7de66336aec406dc017716aaf21 (diff)
downloadluajit-v2.1.tar.gz
luajit-v2.1.tar.bz2
luajit-v2.1.zip
ELF/Mach-O: Force default visibility for public API functions.HEADv2.1
Thanks to Dymphna. #1409
-rw-r--r--src/jit/bcsave.lua2
-rw-r--r--src/luaconf.h2
2 files changed, 4 insertions, 0 deletions
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"
165#endif 165#endif
166#ifdef _WIN32 166#ifdef _WIN32
167__declspec(dllexport) 167__declspec(dllexport)
168#elif (defined(__ELF__) || defined(__MACH__) || defined(__psp2__)) && !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__))
169__attribute__((visibility("default")))
168#endif 170#endif
169const unsigned char %s%s[] = { 171const unsigned char %s%s[] = {
170]], LJBC_PREFIX, ctx.modname)) 172]], 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 @@
132#else 132#else
133#define LUA_API __declspec(dllimport) 133#define LUA_API __declspec(dllimport)
134#endif 134#endif
135#elif (defined(__ELF__) || defined(__MACH__) || defined(__psp2__)) && !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__))
136#define LUA_API extern __attribute__((visibility("default")))
135#else 137#else
136#define LUA_API extern 138#define LUA_API extern
137#endif 139#endif