1 /* Shared library support */
3 #if defined(_WIN32)&&defined(_MSC_VER)
4 #define UL_DLL_IMPORT __declspec(dllimport)
5 #define UL_DLL_EXPORT __declspec(dllexport)
9 #if (__GNUC__ >= 4) && !defined(GCC_HASCLASSVISIBILITY)
10 #define GCC_HASCLASSVISIBILITY
13 #ifdef GCC_HASCLASSVISIBILITY
14 #define UL_DLL_EXPORT __attribute__ ((visibility("default")))
15 #define UL_DLL_LOCAL __attribute__ ((visibility("hidden")))
16 #define UL_DLL_PUBLIC __attribute__ ((visibility("default")))
23 #endif /* UL_EXPORT */
25 /* Define UL_UTAPI for DLL builds */
27 #ifdef UL_UTDLL_EXPORTS
28 #define UL_UTAPI UL_EXPORT
30 #define UL_UTAPI UL_IMPORT
31 #endif /* UL_UTDLL_EXPORTS */
36 /* Throwable classes must always be visible on GCC in all binaries */
37 #if defined(_WIN32)&&defined(_MSC_VER)
38 #define UL_EXCEPTIONAPI(api) api
39 #elif defined(GCC_HASCLASSVISIBILITY)
40 #define UL_EXCEPTIONAPI(api) UL_EXPORT
42 #define UL_EXCEPTIONAPI(api)
45 /* Other possible solution is to use pragmas */
47 * #pragma GCC visibility push(hidden)
48 * extern void someprivatefunct(int);
49 * #pragma GCC visibility pop
52 /* GCC switches to handle visibility */
55 * -fvisibility-inlines-hidden