]> rtime.felk.cvut.cz Git - ulut.git/blob - ulut/ul_utexport.h
Add missing #include
[ulut.git] / ulut / ul_utexport.h
1 /* Shared library support */
2 #ifndef UL_EXPORT
3   #if defined(_WIN32)&&defined(_MSC_VER)
4     #define UL_DLL_IMPORT __declspec(dllimport)
5     #define UL_DLL_EXPORT __declspec(dllexport)
6     #define UL_DLL_LOCAL
7     #define UL_DLL_PUBLIC
8   #else
9     #if (__GNUC__ >= 4) && !defined(GCC_HASCLASSVISIBILITY)
10        #define GCC_HASCLASSVISIBILITY
11     #endif
12     #define UL_DLL_IMPORT
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")))
17     #else
18       #define UL_DLL_EXPORT
19       #define UL_DLL_LOCAL
20       #define UL_DLL_PUBLIC
21     #endif
22   #endif
23 #endif /* UL_EXPORT */
24
25 /* Define UL_UTAPI for DLL builds */
26 #ifdef UL_UTDLL
27   #ifdef UL_UTDLL_EXPORTS
28     #define UL_UTAPI UL_EXPORT
29   #else
30     #define UL_UTAPI  UL_IMPORT
31   #endif /* UL_UTDLL_EXPORTS */
32 #else
33   #define UL_API
34 #endif /* UL_UTDLL */
35
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
41 #else
42   #define UL_EXCEPTIONAPI(api)
43 #endif
44
45 /* Other possible solution is to use pragmas */
46 /*
47  * #pragma GCC visibility push(hidden)
48  * extern void someprivatefunct(int);
49  * #pragma GCC visibility pop
50  */
51
52 /* GCC switches to handle visibility */
53 /*
54  * -fvisibilty=hidden
55  * -fvisibility-inlines-hidden
56  */