TnEHProvider
tn_export.h
Go to the documentation of this file.
1 
10 #ifndef __TN_EXPORT_H__
11 #define __TN_EXPORT_H__
12 
13 // clang-format off
14 
15 // Generic helper definitions for shared library support
16 #if defined _WIN32 || defined __CYGWIN__
17  #define TN_EXPORT_DLL_IMPORT __declspec(dllimport)
18  #define TN_EXPORT_DLL_EXPORT __declspec(dllexport)
19  #define TN_EXPORT_DLL_LOCAL
20 #else
21  #if __GNUC__ >= 4
22  #define TN_EXPORT_DLL_IMPORT __attribute__ ((visibility ("default")))
23  #define TN_EXPORT_DLL_EXPORT __attribute__ ((visibility ("default")))
24  #define TN_EXPORT_DLL_LOCAL __attribute__ ((visibility ("hidden")))
25  #else
26  #define TN_EXPORT_DLL_IMPORT
27  #define TN_EXPORT_DLL_EXPORT
28  #define TN_EXPORT_DLL_LOCAL
29  #endif
30 #endif
31 
32 // Now we use the generic helper definitions above to define TASDK_API and TASDK_API_DECL.
33 // TASDK_API is used for the public published API symbols.
34 // TASDK_API_DECL is used for build dynamic lib.
35 
36 #ifdef TN_EHP_BUILD_DYN_LIB // compile as a dynamic lib
37  #ifdef TN_EHP_NO_EXPORT // use as static lib inside the same component(for internal excutable target)
38  #define TN_EHP_API_DECL
39  #else // export by default
40  #define TN_EHP_API_DECL TN_EXPORT_DLL_EXPORT
41  #endif // TASDK_NO_EXPORT
42 
43  //disable warnings about a "dllexport" class using a regular class
44  #pragma warning(disable: 4251)
45 #else
46  #define TN_EHP_API_DECL
47 #endif
48 
49 #ifdef TN_EHP_DYN_LINK // use as a dynamic lib
50  #define TN_EHP_API TN_EXPORT_DLL_IMPORT
51 #else // use as a static lib
52  #define TN_EHP_API
53 #endif // TN_EHP_BUILD_DYN_LIB
54 
55 // clang-format on
56 
57 #endif //__TN_EXPORT_H__