with comments, less is more
[uri.git] / dll_spec.h
blob233214efeebe7ccf56637352b0ee1bbb90f4041e
1 #ifndef DLL_SPEC_H
2 #define DLL_SPEC_H
4 #if defined _WIN32 || defined __CYGWIN__
6 #ifdef BUILDING_DLL
7 #ifdef __GNUC__
8 #define DLL_PUBLIC __attribute__((dllexport))
9 #else
10 #define DLL_PUBLIC \
11 __declspec( \
12 dllexport) // Note: actually gcc seems to also supports this syntax.
13 #endif
14 #else
15 #ifdef __GNUC__
16 #define DLL_PUBLIC __attribute__((dllimport))
17 #else
18 #define DLL_PUBLIC \
19 __declspec( \
20 dllimport) // Note: actually gcc seems to also supports this syntax.
21 #endif
22 #endif
23 #define DLL_LOCAL
25 #else
27 #if __GNUC__ >= 4
28 #define DLL_PUBLIC __attribute__((visibility("default")))
29 #define DLL_LOCAL __attribute__((visibility("hidden")))
30 #else
31 #define DLL_PUBLIC
32 #define DLL_LOCAL
33 #endif
35 #endif
37 #endif // DLL_SPEC_H