PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/chrono/config.hpp

http://hadesmem.googlecode.com/
C++ Header | 152 lines | 97 code | 25 blank | 30 comment | 26 complexity | dd5d57a7ed4f47cbdf27c36a24377ca9 MD5 | raw file
  1//  boost/chrono/config.hpp  -------------------------------------------------//
  2
  3//  Copyright Beman Dawes 2003, 2006, 2008
  4//  Copyright 2009 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_SOURCE) && !defined(BOOST_USE_WINDOWS_H)
 17#define BOOST_USE_WINDOWS_H
 18#endif
 19
 20//  BOOST_CHRONO_POSIX_API, BOOST_CHRONO_MAC_API, or BOOST_CHRONO_WINDOWS_API
 21//  can be defined by the user to specify which API should be used
 22
 23#if defined(BOOST_CHRONO_WINDOWS_API)
 24# warning Boost.Chrono will use the Windows API
 25#elif defined(BOOST_CHRONO_MAC_API)
 26# warning Boost.Chrono will use the Mac API
 27#elif defined(BOOST_CHRONO_POSIX_API)
 28# warning Boost.Chrono will use the POSIX API
 29#endif
 30
 31# if defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_POSIX_API )
 32#   error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_POSIX_API are defined
 33# elif defined( BOOST_CHRONO_WINDOWS_API ) && defined( BOOST_CHRONO_MAC_API )
 34#   error both BOOST_CHRONO_WINDOWS_API and BOOST_CHRONO_MAC_API are defined
 35# elif defined( BOOST_CHRONO_MAC_API ) && defined( BOOST_CHRONO_POSIX_API )
 36#   error both BOOST_CHRONO_MAC_API and BOOST_CHRONO_POSIX_API are defined
 37# elif !defined( BOOST_CHRONO_WINDOWS_API ) && !defined( BOOST_CHRONO_MAC_API ) && !defined( BOOST_CHRONO_POSIX_API )
 38#   if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32))
 39#     define BOOST_CHRONO_WINDOWS_API
 40#     define BOOST_CHRONO_HAS_CLOCK_STEADY
 41#     define BOOST_CHRONO_HAS_THREAD_CLOCK
 42#     define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
 43#   elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
 44#     define BOOST_CHRONO_MAC_API
 45#     define BOOST_CHRONO_HAS_CLOCK_STEADY
 46#     define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
 47#   else
 48#     define BOOST_CHRONO_POSIX_API
 49#   endif
 50# endif
 51
 52# if defined( BOOST_CHRONO_POSIX_API )
 53#   include <time.h>  //to check for CLOCK_REALTIME and CLOCK_MONOTONIC and _POSIX_THREAD_CPUTIME
 54#   if defined(CLOCK_REALTIME)
 55#     if defined(CLOCK_MONOTONIC)
 56#        define BOOST_CHRONO_HAS_CLOCK_STEADY
 57#     endif
 58#   else
 59#     error <time.h> does not supply CLOCK_REALTIME
 60#   endif
 61#   if defined(_POSIX_THREAD_CPUTIME) && !defined(BOOST_DISABLE_THREADS)
 62#     define BOOST_CHRONO_HAS_THREAD_CLOCK
 63#     define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
 64#   endif
 65#   if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BOOST_DISABLE_THREADS)
 66#     define BOOST_CHRONO_HAS_THREAD_CLOCK
 67#     define BOOST_CHRONO_THREAD_CLOCK_IS_STEADY true
 68#   endif
 69# endif
 70
 71#if defined(BOOST_CHRONO_THREAD_DISABLED) && defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
 72#undef BOOST_CHRONO_HAS_THREAD_CLOCK
 73#undef BOOST_CHRONO_THREAD_CLOCK_IS_STEADY
 74#endif
 75
 76// unicode support  ------------------------------//
 77
 78#if defined(BOOST_NO_UNICODE_LITERALS) || defined(BOOST_NO_CHAR16_T) || defined(BOOST_NO_CHAR32_T)
 79//~ #define BOOST_CHRONO_HAS_UNICODE_SUPPORT
 80#else
 81#define BOOST_CHRONO_HAS_UNICODE_SUPPORT 1
 82#endif
 83
 84//  define constexpr related macros  ------------------------------//
 85
 86#if defined(BOOST_NO_CONSTEXPR)
 87#define BOOST_CHRONO_CONSTEXPR
 88#define BOOST_CHRONO_CONSTEXPR_OR_CONST const
 89#define BOOST_CHRONO_CONST_REF const&
 90#else
 91#define BOOST_CHRONO_CONSTEXPR constexpr
 92#define BOOST_CHRONO_CONSTEXPR_OR_CONST constexpr
 93#define BOOST_CHRONO_CONST_REF
 94#endif
 95
 96#define BOOST_CHRONO_STATIC_CONSTEXPR  static BOOST_CHRONO_CONSTEXPR_OR_CONST
 97
 98
 99#ifdef BOOST_CHRONO_HEADER_ONLY
100#define BOOST_CHRONO_INLINE inline
101#define BOOST_CHRONO_STATIC
102#define BOOST_CHRONO_DECL
103
104#else
105#define BOOST_CHRONO_INLINE
106#define BOOST_CHRONO_STATIC static
107
108//  enable dynamic linking on Windows  ---------------------------------------//
109
110#ifdef BOOST_HAS_DECLSPEC // defined by boost.config
111// we need to import/export our code only if the user has specifically
112// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
113// libraries to be dynamically linked, or BOOST_CHRONO_DYN_LINK
114// if they want just this one to be dynamically liked:
115#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
116// export if this is our own source, otherwise import:
117#ifdef BOOST_CHRONO_SOURCE
118# define BOOST_CHRONO_DECL __declspec(dllexport)
119#else
120# define BOOST_CHRONO_DECL __declspec(dllimport)
121#endif  // BOOST_CHRONO_SOURCE
122#endif  // DYN_LINK
123#endif  // BOOST_HAS_DECLSPEC
124//
125// if BOOST_CHRONO_DECL isn't defined yet define it now:
126#ifndef BOOST_CHRONO_DECL
127#define BOOST_CHRONO_DECL
128#endif
129
130
131//  enable automatic library variant selection  ------------------------------//
132
133#if !defined(BOOST_CHRONO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CHRONO_NO_LIB)
134//
135// Set the name of our library; this will get undef'ed by auto_link.hpp
136// once it's done with it:
137//
138#define BOOST_LIB_NAME boost_chrono
139//
140// If we're importing code from a dll, then tell auto_link.hpp about it:
141//
142#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CHRONO_DYN_LINK)
143#  define BOOST_DYN_LINK
144#endif
145//
146// And include the header that does the work:
147//
148#include <boost/config/auto_link.hpp>
149#endif  // auto-linking disabled
150#endif // BOOST_CHRONO_HEADER_ONLY
151#endif // BOOST_CHRONO_CONFIG_HPP
152