From 26755cad99cd2a362a3f149114a2e7f05928db0a Mon Sep 17 00:00:00 2001 From: Roberto I Date: Sat, 18 Oct 2025 10:30:12 -0300 Subject: Added "attribute internal" to __MACH__ platforms Also, makefile does not add compiling options (LOCAL) to linker flags (MYLDFLAGS). --- llimits.h | 18 +++++++++--------- makefile | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llimits.h b/llimits.h index 21632543..fc5cb276 100644 --- a/llimits.h +++ b/llimits.h @@ -303,21 +303,21 @@ typedef unsigned long l_uint32; ** LUAI_DDEF and LUAI_DDEC are marks for all extern (const) variables, ** none of which to be exported to outside modules (LUAI_DDEF for ** definitions and LUAI_DDEC for declarations). -** Elf/gcc (versions 3.2 and later) mark them as "hidden" to optimize -** access when Lua is compiled as a shared library. Not all elf targets -** support this attribute. Unfortunately, gcc does not offer a way to -** check whether the target offers that support, and those without -** support give a warning about it. To avoid these warnings, change to -** the default definition. +** Elf and MACH/gcc (versions 3.2 and later) mark them as "hidden" to +** optimize access when Lua is compiled as a shared library. Not all elf +** targets support this attribute. Unfortunately, gcc does not offer +** a way to check whether the target offers that support, and those +** without support give a warning about it. To avoid these warnings, +** change to the default definition. */ #if !defined(LUAI_FUNC) #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) /* { */ + (defined(__ELF__) || defined(__MACH__)) #define LUAI_FUNC __attribute__((visibility("internal"))) extern -#else /* }{ */ +#else #define LUAI_FUNC extern -#endif /* } */ +#endif #define LUAI_DDEC(dec) LUAI_FUNC dec #define LUAI_DDEF /* empty */ diff --git a/makefile b/makefile index 2a8ca489..8674519f 100644 --- a/makefile +++ b/makefile @@ -72,7 +72,7 @@ LOCAL = $(TESTS) $(CWARNS) # For C89, "-std=c89 -DLUA_USE_C89" # Note that Linux/Posix options are not compatible with C89 MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -MYLDFLAGS= $(LOCAL) -Wl,-E +MYLDFLAGS= -Wl,-E MYLIBS= -ldl -- cgit v1.2.3-55-g6feb