]> rtime.felk.cvut.cz Git - can-usb1.git/blob - ulan/host/libs4c/ulut/ul_utexport.h
Initializing repo
[can-usb1.git] / ulan / host / libs4c / ulut / ul_utexport.h
1 /* Shared library support */
2 #ifndef UL_EXPORT
3   #if defined(_WIN32)&&defined(_MSC_VER)
4     #define UL_IMPORT __declspec(dllimport)
5     #define UL_EXPORT __declspec(dllexport)
6     #define UL_DLLLOCAL
7     #define UL_DLLPUBLIC
8   #else
9     #define UL_IMPORT
10     #ifdef GCC_HASCLASSVISIBILITY
11       #define UL_EXPORT __attribute__ ((visibility("default")))
12       #define UL_DLLLOCAL __attribute__ ((visibility("hidden")))
13       #define UL_DLLPUBLIC __attribute__ ((visibility("default")))
14     #else
15       #define UL_EXPORT
16       #define UL_DLLLOCAL
17       #define UL_DLLPUBLIC
18     #endif
19   #endif
20 #endif /* UL_EXPORT */
21
22 /* Define UL_UTAPI for DLL builds */
23 #ifdef UL_UTDLL
24   #ifdef UL_UTDLL_EXPORTS
25     #define UL_UTAPI UL_EXPORT
26   #else
27     #define UL_UTAPI  UL_IMPORT
28   #endif /* UL_UTDLL_EXPORTS */
29 #else
30   #define UL_API
31 #endif /* UL_UTDLL */
32
33 /* Throwable classes must always be visible on GCC in all binaries */
34 #if defined(_WIN32)&&defined(_MSC_VER)
35   #define UL_EXCEPTIONAPI(api) api
36 #elif defined(GCC_HASCLASSVISIBILITY)
37   #define UL_EXCEPTIONAPI(api) UL_EXPORT
38 #else
39   #define UL_EXCEPTIONAPI(api)
40 #endif
41
42 /* Other possible solution is to use pragmas */
43 /*
44  * #pragma GCC visibility push(hidden)
45  * extern void someprivatefunct(int);
46  * #pragma GCC visibility pop
47  */
48
49 /* GCC switches to handle visibility */
50 /*
51  * -fvisibilty=hidden
52  * -fvisibility-inlines-hidden
53  */