Conscience Core
os.h
Go to the documentation of this file.
1 #ifndef util_os_H
2 #define util_os_H
3 
4 #include <boost/predef.h>
5 
6 #if BOOST_OS_WINDOWS
7 #define CSC_OS_WINDOWS 1
8 #elif BOOST_OS_LINUX
9 #define CSC_OS_LINUX 1
10 #elif BOOST_OS_MACOS
11 #define CSC_OS_MACOS 1
12 #endif
13 
14 #if CSC_OS_WINDOWS == 1
15 #define CSC_USER_DLL_EXPORT __declspec(dllexport)
16 #else
17 #define CSC_USER_DLL_EXPORT
18 #endif
19 
20 // very important: on Windows, DLL cannot export a lot of symbols. It is possible to export all but it includes headers public members, hence a lot of potentially useless symbols
21 // we choose here, as the best practice commands us, to put on
22 #if CSC_OS_WINDOWS == 1
23  #if defined(CSC_CORE_BUILD)
24  #define CSC_DLL_IMPORTEXPORT __declspec(dllexport)
25  #elif defined(CSC_CORE_DLL)
26  #define CSC_DLL_IMPORTEXPORT __declspec(dllimport)
27  #else
28  #define CSC_DLL_IMPORTEXPORT
29  #endif
30 #else
31  #define CSC_DLL_IMPORTEXPORT
32 #endif
33 
34 #endif