export.h
1 #ifndef _EXPORT_H_
2 #define _EXPORT_H_
3 
4 #pragma once
5 
6 
7 #if defined(_WIN32)
8  // Microsoft
9  #define HELPER_DLL_EXPORT __declspec(dllexport)
10  #define HELPER_DLL_IMPORT __declspec(dllimport)
11 #elif defined(__GNUC__)
12  // GCC
13  #define HELPER_DLL_EXPORT __attribute__((visibility("default")))
14  #define HELPER_DLL_IMPORT __attribute__((visibility("default")))
15 #else
16  // do nothing and hope for the best?
17  #define HELPER_DLL_EXPORT
18  #define HELPER_DLL_IMPORT
19  #pragma warning Unknown dynamic link import/export semantics.
20 #endif
21 
22 
23 #ifdef DMXSDK_EXPORTS // defined if we are building the DLL (instead of using it)
24  #define DMXSDK_API HELPER_DLL_EXPORT
25 #else
26  #define DMXSDK_API HELPER_DLL_IMPORT
27 #endif // DMXSDK_EXPORTS
28 
29 
30 
31 #endif /* _EXPORT_H_ */
32 // https://gcc.gnu.org/wiki/Visibility