From dfcd2e354322c82e550923db30d1cf709618c6ce Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 6 Apr 2010 21:04:32 +0200 Subject: [PATCH] Unified DLL/shared library export import symbol visibility specification. This is more or less how Wikipedia example suggests the macros names and use. To change default symbols visibility next options should be specified in config.omk file. CFLAGS += -fvisibility=hidden LDLAGS += -fvisibility=hidden Signed-off-by: Pavel Pisa --- ulut/ul_utexport.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ulut/ul_utexport.h b/ulut/ul_utexport.h index 4abe376..1bed464 100644 --- a/ulut/ul_utexport.h +++ b/ulut/ul_utexport.h @@ -1,20 +1,23 @@ /* Shared library support */ #ifndef UL_EXPORT #if defined(_WIN32)&&defined(_MSC_VER) - #define UL_IMPORT __declspec(dllimport) - #define UL_EXPORT __declspec(dllexport) - #define UL_DLLLOCAL - #define UL_DLLPUBLIC + #define UL_DLL_IMPORT __declspec(dllimport) + #define UL_DLL_EXPORT __declspec(dllexport) + #define UL_DLL_LOCAL + #define UL_DLL_PUBLIC #else - #define UL_IMPORT + #if (__GNUC__ >= 4) && !defined(GCC_HASCLASSVISIBILITY) + #define GCC_HASCLASSVISIBILITY + #endif + #define UL_DLL_IMPORT #ifdef GCC_HASCLASSVISIBILITY - #define UL_EXPORT __attribute__ ((visibility("default"))) - #define UL_DLLLOCAL __attribute__ ((visibility("hidden"))) - #define UL_DLLPUBLIC __attribute__ ((visibility("default"))) + #define UL_DLL_EXPORT __attribute__ ((visibility("default"))) + #define UL_DLL_LOCAL __attribute__ ((visibility("hidden"))) + #define UL_DLL_PUBLIC __attribute__ ((visibility("default"))) #else - #define UL_EXPORT - #define UL_DLLLOCAL - #define UL_DLLPUBLIC + #define UL_DLL_EXPORT + #define UL_DLL_LOCAL + #define UL_DLL_PUBLIC #endif #endif #endif /* UL_EXPORT */ -- 2.39.2