From c9f0a7843260c44d2b7e2d2842e701586ed10260 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 1 Nov 2022 03:56:09 -0400 Subject: [PATCH] unconditionally define decl exports for GNU-style visibility Unlike on Windows, it is perfectly acceptable to set symbol visibility for static libraries, and it magically works. In fact, it even beneficially does something useful. This simplifies the code by avoiding special cases. --- include/mimalloc.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/mimalloc.h b/include/mimalloc.h index 335483391..a10e83857 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -58,11 +58,7 @@ terms of the MIT license. A copy of the license can be found in the file #define mi_attr_alloc_size2(s1,s2) #define mi_attr_alloc_align(p) #elif defined(__GNUC__) // includes clang and icc - #if defined(MI_SHARED_LIB) && defined(MI_SHARED_LIB_EXPORT) - #define mi_decl_export __attribute__((visibility("default"))) - #else - #define mi_decl_export - #endif + #define mi_decl_export __attribute__((visibility("default"))) #define mi_cdecl // leads to warnings... __attribute__((cdecl)) #define mi_decl_restrict #define mi_attr_malloc __attribute__((malloc))