config.h
Go to the documentation of this file.
1 // ===========================================================================
2 // Copyright (c) 2011-2012 University of Pennsylvania
3 // Copyright (c) 2013-2016 Andreas Schuh
4 // All rights reserved.
5 //
6 // See COPYING file for license information or visit
7 // https://cmake-basis.github.io/download.html#license
8 // ===========================================================================
9 
10 /**
11  * @file config.h
12  * @brief System related macro definitions.
13  */
14 
15 #pragma once
16 #ifndef _BASIS_CONFIG_H
17 #define _BASIS_CONFIG_H
18 
19 
20 /// @addtogroup BasisCxxUtilities
21 /// @{
22 
23 
24 /// @def LINUX
25 /// @brief Whether the sources are compiled on a Linux system.
26 #ifndef LINUX
27 # if defined (linux) || defined (__linux)
28 # define LINUX 1
29 # else
30 # define LINUX 0
31 # endif
32 #endif
33 
34 /// @def WINDOWS
35 /// @brief Whether the sources are compiled on a Windows system.
36 #ifndef WINDOWS
37 # if defined (_WIN32) || defined (WIN32) || defined (_WINDOWS)
38 # define WINDOWS 1
39 # else
40 # define WINDOWS 0
41 # endif
42 #endif
43 
44 /// @def MACOS
45 /// @brief Whether the sources are compiled on a Mac OS system.
46 #ifndef MACOS
47 # if defined (__APPLE__) || defined (__OSX__)
48 # define MACOS 1
49 # else
50 # define MACOS 0
51 # endif
52 #endif
53 
54 /// @def UNIX
55 /// @brief Whether the sources are compiled on a Unix-based system.
56 #ifndef UNIX
57 # if WINDOWS
58 # define UNIX 0
59 # else
60 # define UNIX 1
61 # endif
62 #endif
63 
64 /// @def HAVE_LONG_LONG
65 /// @brief Whether the long long type is supported by the compiler.
66 #ifndef HAVE_LONG_LONG
67 # define HAVE_LONG_LONG 1
68 #endif
69 
70 /// @def HAVE_SSTREAM
71 /// @brief Whether the ANSI string stream classes are available.
72 #ifndef HAVE_SSTREAM
73 # define HAVE_SSTREAM 1
74 #endif
75 
76 /**
77  * @def HAVE_STRSTREAM
78  * @brief Whether the obsolete string stream classes are available.
79  *
80  * @note As the strstream implementations are obsolete already for a long
81  * time, this macro always evaluates to 0.
82  */
83 #ifdef HAVE_STRSTREAM
84 # undef HAVE_STRSTREAM
85 #endif
86 #define HAVE_STRSTREAM 0
87 
88 /// @def HAVE_PTHREAD
89 /// @brief Whether the pthread library is available.
90 #ifndef HAVE_PTHREAD
91 # define HAVE_PTHREAD 1
92 #endif
93 
94 /**
95  * @def HAVE_TR1_TUPLE
96  * @brief Whether the tr1/tuple header file is available.
97  *
98  * @note This header file is only more recently supported by compilers
99  * and be used by Google Test, for example. If not supported by
100  * the compiler, Google Test can use it's own implementation.
101  */
102 #ifndef HAVE_TR1_TUPLE
103 # define HAVE_TR1_TUPLE 0
104 #endif
105 
106 
107 /// @}
108 // end of Doxygen group
109 
110 #endif // _BASIS_CONFIG_H