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 <pisa@cmp.felk.cvut.cz>
/* Shared library support */
#ifndef UL_EXPORT
#if defined(_WIN32)&&defined(_MSC_VER)
/* 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
+ #if (__GNUC__ >= 4) && !defined(GCC_HASCLASSVISIBILITY)
+ #define GCC_HASCLASSVISIBILITY
+ #endif
+ #define UL_DLL_IMPORT
#ifdef GCC_HASCLASSVISIBILITY
#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")))
- #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 */
#endif
#endif
#endif /* UL_EXPORT */