Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:36

0001 #ifndef DATE_TIME_COMPILER_CONFIG_HPP___
0002 #define DATE_TIME_COMPILER_CONFIG_HPP___
0003 
0004 /* Copyright (c) 2002-2004 CrystalClear Software, Inc.
0005  * Subject to the Boost Software License, Version 1.0. (See accompanying
0006  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0007  * Author: Jeff Garland, Bart Garst
0008  * $Date$
0009  */
0010 
0011 #include <cstdlib>
0012 #include <boost/config.hpp>
0013 #include <boost/detail/workaround.hpp>
0014 
0015 
0016 // This file performs some local compiler configurations
0017 
0018 #include <boost/date_time/locale_config.hpp> //set up locale configurations
0019 
0020 //Set up a configuration parameter for platforms that have 
0021 //GetTimeOfDay
0022 #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME)
0023 #define BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK
0024 #endif
0025 
0026 // To Force no default constructors for date & ptime, un-comment following
0027 //#define DATE_TIME_NO_DEFAULT_CONSTRUCTOR
0028 
0029 // Include extensions to date_duration - comment out to remove this feature
0030 #define BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES
0031 
0032 #if (defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) || BOOST_WORKAROUND( BOOST_BORLANDC,  BOOST_TESTED_AT(0x581) ) )
0033 #define BOOST_DATE_TIME_NO_MEMBER_INIT
0034 #endif
0035 
0036 // include these types before we try to re-define them
0037 #include <boost/cstdint.hpp>
0038 
0039 //Define INT64_C for compilers that don't have it
0040 #if (!defined(INT64_C))
0041 #define INT64_C(value)  int64_t(value)
0042 #endif
0043 
0044 
0045 /* Workaround for Borland iterator error. Error was "Cannot convert 'istream *' to 'wistream *' in function istream_iterator<>::istream_iterator() */
0046 #if defined(BOOST_BORLANDC) && defined(BOOST_BCB_WITH_RW_LIB)
0047 #define BOOST_DATE_TIME_NO_WISTREAM_ITERATOR
0048 #endif
0049 
0050 
0051 // Borland v5.64 does not have the following in std namespace; v5.5.1 does
0052 #if defined(BOOST_BORLANDC) && defined(BOOST_BCB_WITH_STLPORT)
0053 #include <locale>
0054 namespace std {
0055   using stlport::tolower;
0056   using stlport::ctype;
0057   using stlport::use_facet;
0058 }
0059 #endif
0060 
0061 // workaround for errors associated with output for date classes 
0062 // modifications and input streaming for time classes. 
0063 // Compilers affected are:
0064 // gcc295, msvc (neither with STLPort), any borland
0065 // 
0066 #if (((defined(__GNUC__) && (__GNUC__ < 3)) || \
0067       (defined(_MSC_VER) && (_MSC_VER < 1300)) ) && \
0068       !defined(_STLP_OWN_IOSTREAMS) ) || \
0069       BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x581) )
0070 #define BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS
0071 #endif
0072 
0073 // The macro marks up places where compiler complains for missing return statement or
0074 // uninitialized variables after calling to boost::throw_exception.
0075 // BOOST_UNREACHABLE_RETURN doesn't work since even compilers that support
0076 // unreachable statements detection emit such warnings.
0077 #if defined(_MSC_VER)
0078 // Use special MSVC extension to markup unreachable code
0079 #  define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) __assume(false)
0080 #elif !defined(BOOST_NO_UNREACHABLE_RETURN_DETECTION)
0081 // Call to a non-returning function should suppress the warning
0082 #  if defined(BOOST_NO_STDC_NAMESPACE)
0083 namespace std {
0084     using ::abort;
0085 }
0086 #  endif // defined(BOOST_NO_STDC_NAMESPACE)
0087 #  define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) std::abort()
0088 #else
0089 // For other poor compilers the specified expression is compiled. Usually, this would be a return statement.
0090 #  define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) x
0091 #endif
0092 
0093 /* The following handles the definition of the necessary macros
0094  * for dll building on Win32 platforms.
0095  * 
0096  * For code that will be placed in the date_time .dll, 
0097  * it must be properly prefixed with BOOST_DATE_TIME_DECL.
0098  * The corresponding .cpp file must have BOOST_DATE_TIME_SOURCE
0099  * defined before including its header. For examples see:
0100  * greg_month.hpp & greg_month.cpp
0101  * 
0102  */
0103 
0104 // we need to import/export our code only if the user has specifically
0105 // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
0106 // libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK
0107 // if they want just this one to be dynamically liked:
0108 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK)
0109     // export if this is our own source, otherwise import:
0110 #   ifdef BOOST_DATE_TIME_SOURCE
0111 #     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT
0112 #   else
0113 #     define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT
0114 #   endif  // BOOST_DATE_TIME_SOURCE
0115 #endif  // DYN_LINK
0116 //
0117 // if BOOST_WHATEVER_DECL isn't defined yet define it now:
0118 #ifndef BOOST_DATE_TIME_DECL
0119 #  define BOOST_DATE_TIME_DECL
0120 #endif
0121 
0122 
0123 #if defined(BOOST_HAS_THREADS) 
0124 #  if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) ||  defined(__BORLANDC__)
0125      //no reentrant posix functions (eg: localtime_r)
0126 #  elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT)))
0127 #   define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
0128 #  endif
0129 #endif
0130 
0131 #if defined(BOOST_NO_CXX11_NULLPTR)
0132 #  define BOOST_DATE_TIME_NULLPTR 0
0133 #else
0134 #  define BOOST_DATE_TIME_NULLPTR nullptr
0135 #endif
0136 
0137 #endif