comparison DEPENDENCIES/generic/include/boost/chrono/config.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 // boost/chrono/config.hpp -------------------------------------------------//
2
3 // Copyright Beman Dawes 2003, 2006, 2008
4 // Copyright 2009-2011 Vicente J. Botet Escriba
5
6 // Distributed under the Boost Software License, Version 1.0. (See accompanying
7 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8
9 // See http://www.boost.org/libs/chrono for documentation.
10
11 #ifndef BOOST_CHRONO_CONFIG_HPP
12 #define BOOST_CHRONO_CONFIG_HPP
13
14 #include <boost/config.hpp>
15
16 #if !defined BOOST_CHRONO_VERSION
17 #define BOOST_CHRONO_VERSION 1
18 #else
19 #if BOOST_CHRONO_VERSION!=1 && BOOST_CHRONO_VERSION!=2
20 #error "BOOST_CHRONO_VERSION must be 1 or 2"
21 #endif
22 #endif
23
24 #if defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_USE_WINDOWS_H)
25 #define BOOST_USE_WINDOWS_H
26 #endif
27
28 #if ! defined BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT \
29 && ! defined BOOST_CHRONO_DONT_PROVIDE_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
30
31 # define BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
32
33 #endif
34
35 // BOOST_CHRONO_POSIX_API, BOOST_CHRONO_MAC_API, or BOOST_CHRONO_WINDOWS_API
36 // can be defined by the user to specify which API should be used
37
38 #if defined(BOOST_CHRONO_WINDOWS_API)
39 # warning Boost.Chrono will use the Windows API
40 #elif defined(BOOST_CHRONO_MAC_API)
41 # warning Boost.Chrono will use the Mac API
42 #elif defined(BOOST_CHRONO_POSIX_API)
43 # warning Boost.Chrono will use the POSIX API
44 #endif
45
46 # if defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_POSIX_API )
47 # error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_POSIX_API are defined
48 # elif defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_MAC_API )
49 # error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_MAC_API are defined
50 # elif defined( BOOST_CHRONO_MAC_API ) && defined( BOOST_CHRONO_POSIX_API )
51 # error both BOOST_CHRONO_MAC_API and BOOST_CHRONO_POSIX_API are defined
52 # elif !defined( BOOST_CHRONO_WINDOWS_API ) && !defined( BOOST_CHRONO_MAC_API ) && !defined( BOOST_CHRONO_POSIX_API )
53 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
54 # define BOOST_CHRONO_WINDOWS_API
55 # elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
56 # define BOOST_CHRONO_MAC_API
57 # else
58 # define BOOST_CHRONO_POSIX_API
59 # endif
60 # endif
61
62 # if defined( BOOST_CHRONO_WINDOWS_API )
63 # ifndef UNDER_CE
64 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
65 # endif
66 # define BOOST_CHRONO_HAS_CLOCK_STEADY
67 # define BOOST_CHRONO_HAS_THREAD_CLOCK
68 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
69 # endif
70
71 # if defined( BOOST_CHRONO_MAC_API )
72 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
73 # define BOOST_CHRONO_HAS_CLOCK_STEADY
74 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
75 # endif
76
77 # if defined( BOOST_CHRONO_POSIX_API )
78 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
79 # include <time.h> //to check for CLOCK_REALTIME and CLOCK_MONOTONIC and _POSIX_THREAD_CPUTIME
80 # if defined(CLOCK_MONOTONIC)
81 # define BOOST_CHRONO_HAS_CLOCK_STEADY
82 # endif
83 # if defined(_POSIX_THREAD_CPUTIME) && !defined(BOOST_DISABLE_THREADS)
84 # define BOOST_CHRONO_HAS_THREAD_CLOCK
85 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
86 # endif
87 # if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BOOST_DISABLE_THREADS)
88 # define BOOST_CHRONO_HAS_THREAD_CLOCK
89 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
90 # endif
91 # if defined(sun) || defined(__sun)
92 # undef BOOST_CHRONO_HAS_THREAD_CLOCK
93 # undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
94 # endif
95 # if defined(__HP_aCC) && defined(__hpux)
96 # undef BOOST_CHRONO_HAS_THREAD_CLOCK
97 # undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
98 # endif
99 # if defined(__VXWORKS__)
100 # undef BOOST_CHRONO_HAS_PROCESS_CLOCKS
101 # endif
102 # endif
103
104 #if defined(BOOST_CHRONO_THREAD_DISABLED) && defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
105 #undef BOOST_CHRONO_HAS_THREAD_CLOCK
106 #undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
107 #endif
108
109 //#undef BOOST_CHRONO_HAS_PROCESS_CLOCKS
110
111 // unicode support ------------------------------//
112
113 #if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T)
114 //~ #define BOOST_CHRONO_HAS_UNICODE_SUPPORT
115 #else
116 #define BOOST_CHRONO_HAS_UNICODE_SUPPORT 1
117 #endif
118
119 #if ! defined BOOST_NOEXCEPT
120 #if defined(BOOST_NO_CXX11_NOEXCEPT)
121 #define BOOST_NOEXCEPT
122 #else
123 #define BOOST_NOEXCEPT noexcept
124 #endif
125 #endif
126
127 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
128 #define BOOST_CHRONO_LIB_CONSTEXPR
129 #elif defined(_LIBCPP_VERSION) && !defined(_LIBCPP_CONSTEXPR)
130 #define BOOST_CHRONO_LIB_CONSTEXPR
131 #else
132 #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR
133 #endif
134
135 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
136 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
137 #else
138 #ifdef BOOST_NO_CXX11_NOEXCEPT
139 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
140 #else
141 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW noexcept
142 #endif
143 #endif
144
145
146 #if defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
147 && defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
148 #error "BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING && BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING defined"
149 #endif
150
151 #if defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
152 && defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
153 #error "BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 && BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 defined"
154 #endif
155
156 #if ! defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
157 && ! defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
158 #define BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING
159 #endif
160
161 #if (BOOST_CHRONO_VERSION == 2)
162 #if ! defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
163 && ! defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
164 #define BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
165 #endif
166 #endif
167
168 #ifdef BOOST_CHRONO_HEADER_ONLY
169 #define BOOST_CHRONO_INLINE inline
170 #define BOOST_CHRONO_STATIC inline
171 #define BOOST_CHRONO_DECL
172
173 #else
174 #define BOOST_CHRONO_INLINE
175 #define BOOST_CHRONO_STATIC static
176
177 // enable dynamic linking on Windows ---------------------------------------//
178
179 // we need to import/export our code only if the user has specifically
180 // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
181 // libraries to be dynamically linked, or BOOST_CHRONO_DYN_LINK
182 // if they want just this one to be dynamically liked:
183 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
184 // export if this is our own source, otherwise import:
185 #ifdef BOOST_CHRONO_SOURCE
186 # define BOOST_CHRONO_DECL BOOST_SYMBOL_EXPORT
187 #else
188 # define BOOST_CHRONO_DECL BOOST_SYMBOL_IMPORT
189 #endif // BOOST_CHRONO_SOURCE
190 #endif // DYN_LINK
191 //
192 // if BOOST_CHRONO_DECL isn't defined yet define it now:
193 #ifndef BOOST_CHRONO_DECL
194 #define BOOST_CHRONO_DECL
195 #endif
196
197
198
199 // enable automatic library variant selection ------------------------------//
200
201 #if !defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CHRONO_NO_LIB)
202 //
203 // Set the name of our library; this will get undef'ed by auto_link.hpp
204 // once it's done with it:
205 //
206 #define BOOST_LIB_NAME boost_chrono
207 //
208 // If we're importing code from a dll, then tell auto_link.hpp about it:
209 //
210 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
211 # define BOOST_DYN_LINK
212 #endif
213 //
214 // And include the header that does the work:
215 //
216 #include <boost/config/auto_link.hpp>
217 #endif // auto-linking disabled
218 #endif // BOOST_CHRONO_HEADER_ONLY
219 #endif // BOOST_CHRONO_CONFIG_HPP
220