File indexing completed on 2025-01-18 09:29:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_CHRONO_CONFIG_HPP
0013 #define BOOST_CHRONO_CONFIG_HPP
0014
0015 #include <boost/chrono/detail/requires_cxx11.hpp>
0016 #include <boost/config.hpp>
0017 #include <boost/predef.h>
0018
0019 #if !defined BOOST_CHRONO_VERSION
0020 #define BOOST_CHRONO_VERSION 1
0021 #else
0022 #if BOOST_CHRONO_VERSION!=1 && BOOST_CHRONO_VERSION!=2
0023 #error "BOOST_CHRONO_VERSION must be 1 or 2"
0024 #endif
0025 #endif
0026
0027 #if defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_USE_WINDOWS_H)
0028 #define BOOST_USE_WINDOWS_H
0029 #endif
0030
0031 #if ! defined BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT \
0032 && ! defined BOOST_CHRONO_DONT_PROVIDE_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
0033
0034 # define BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
0035
0036 #endif
0037
0038
0039
0040
0041 #if defined(BOOST_CHRONO_WINDOWS_API)
0042 # warning Boost.Chrono will use the Windows API
0043 #elif defined(BOOST_CHRONO_MAC_API)
0044 # warning Boost.Chrono will use the Mac API
0045 #elif defined(BOOST_CHRONO_POSIX_API)
0046 # warning Boost.Chrono will use the POSIX API
0047 #endif
0048
0049 # if defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_POSIX_API )
0050 # error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_POSIX_API are defined
0051 # elif defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_MAC_API )
0052 # error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_MAC_API are defined
0053 # elif defined( BOOST_CHRONO_MAC_API ) && defined( BOOST_CHRONO_POSIX_API )
0054 # error both BOOST_CHRONO_MAC_API and BOOST_CHRONO_POSIX_API are defined
0055 # elif !defined( BOOST_CHRONO_WINDOWS_API ) && !defined( BOOST_CHRONO_MAC_API ) && !defined( BOOST_CHRONO_POSIX_API )
0056 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
0057 # define BOOST_CHRONO_WINDOWS_API
0058 # elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
0059 # define BOOST_CHRONO_MAC_API
0060 # else
0061 # define BOOST_CHRONO_POSIX_API
0062 # endif
0063 # endif
0064
0065 # if defined( BOOST_CHRONO_WINDOWS_API )
0066 # ifndef UNDER_CE
0067 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
0068 # endif
0069 # define BOOST_CHRONO_HAS_CLOCK_STEADY
0070 # if BOOST_PLAT_WINDOWS_DESKTOP
0071 # define BOOST_CHRONO_HAS_THREAD_CLOCK
0072 # endif
0073 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
0074 # endif
0075
0076 # if defined( BOOST_CHRONO_MAC_API )
0077 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
0078 # define BOOST_CHRONO_HAS_CLOCK_STEADY
0079 # define BOOST_CHRONO_HAS_THREAD_CLOCK
0080 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
0081 # endif
0082
0083 # if defined( BOOST_CHRONO_POSIX_API )
0084 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
0085 # include <time.h> //to check for CLOCK_REALTIME and CLOCK_MONOTONIC and _POSIX_THREAD_CPUTIME
0086 # if defined(CLOCK_MONOTONIC)
0087 # define BOOST_CHRONO_HAS_CLOCK_STEADY
0088 # endif
0089 # if defined(_POSIX_THREAD_CPUTIME) && !defined(BOOST_DISABLE_THREADS)
0090 # define BOOST_CHRONO_HAS_THREAD_CLOCK
0091 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
0092 # endif
0093 # if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BOOST_DISABLE_THREADS)
0094 # define BOOST_CHRONO_HAS_THREAD_CLOCK
0095 # define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
0096 # endif
0097 # if defined(sun) || defined(__sun)
0098 # undef BOOST_CHRONO_HAS_THREAD_CLOCK
0099 # undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
0100 # endif
0101 # if (defined(__HP_aCC) || defined(__GNUC__)) && defined(__hpux)
0102 # undef BOOST_CHRONO_HAS_THREAD_CLOCK
0103 # undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
0104 # endif
0105 # if defined(__VXWORKS__)
0106 # undef BOOST_CHRONO_HAS_PROCESS_CLOCKS
0107 # endif
0108 # endif
0109
0110 #if defined(BOOST_CHRONO_THREAD_DISABLED) && defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
0111 #undef BOOST_CHRONO_HAS_THREAD_CLOCK
0112 #undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
0113 #endif
0114
0115
0116
0117 #if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T)
0118
0119 #else
0120 #define BOOST_CHRONO_HAS_UNICODE_SUPPORT 1
0121 #endif
0122
0123 #ifndef BOOST_CHRONO_LIB_CONSTEXPR
0124 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
0125 #define BOOST_CHRONO_LIB_CONSTEXPR
0126 #elif defined(_LIBCPP_VERSION) && !defined(_LIBCPP_CONSTEXPR)
0127 #define BOOST_CHRONO_LIB_CONSTEXPR
0128 #else
0129 #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR
0130 #endif
0131 #endif
0132
0133 #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
0134 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
0135 #else
0136 #ifdef BOOST_NO_CXX11_NOEXCEPT
0137 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
0138 #else
0139 # define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW noexcept
0140 #endif
0141 #endif
0142
0143 #if defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
0144 && defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
0145 #error "BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING && BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING defined"
0146 #endif
0147
0148 #if defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
0149 && defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
0150 #error "BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 && BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 defined"
0151 #endif
0152
0153 #if ! defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
0154 && ! defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
0155 #define BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING
0156 #endif
0157
0158 #if (BOOST_CHRONO_VERSION == 2)
0159 #if ! defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
0160 && ! defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
0161 #define BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
0162 #endif
0163 #endif
0164
0165 #ifdef BOOST_CHRONO_HEADER_ONLY
0166 #define BOOST_CHRONO_INLINE inline
0167 #define BOOST_CHRONO_STATIC inline
0168 #define BOOST_CHRONO_DECL
0169
0170 #else
0171 #define BOOST_CHRONO_INLINE
0172 #define BOOST_CHRONO_STATIC static
0173
0174
0175
0176
0177
0178
0179
0180 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
0181
0182 #ifdef BOOST_CHRONO_SOURCE
0183 # define BOOST_CHRONO_DECL BOOST_SYMBOL_EXPORT
0184 #else
0185 # define BOOST_CHRONO_DECL BOOST_SYMBOL_IMPORT
0186 #endif
0187 #endif
0188
0189
0190 #ifndef BOOST_CHRONO_DECL
0191 #define BOOST_CHRONO_DECL
0192 #endif
0193
0194
0195
0196
0197
0198 #if !defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CHRONO_NO_LIB)
0199
0200
0201
0202
0203 #define BOOST_LIB_NAME boost_chrono
0204
0205
0206
0207 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
0208 # define BOOST_DYN_LINK
0209 #endif
0210
0211
0212
0213 #include <boost/config/auto_link.hpp>
0214 #endif
0215 #endif
0216
0217 #endif
0218