Chris@16: #ifndef DATE_TIME_COMPILER_CONFIG_HPP___ Chris@16: #define DATE_TIME_COMPILER_CONFIG_HPP___ Chris@16: Chris@16: /* Copyright (c) 2002-2004 CrystalClear Software, Inc. Chris@16: * Subject to the Boost Software License, Version 1.0. (See accompanying Chris@16: * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Author: Jeff Garland, Bart Garst Chris@101: * $Date$ Chris@16: */ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: // With boost release 1.33, date_time will be using a different, Chris@16: // more flexible, IO system. This new system is not compatible with Chris@16: // old compilers. The original date_time IO system remains for those Chris@16: // compilers. They must define this macro to use the legacy IO. Chris@16: // (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0581) ) ) && Chris@16: #if( BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) \ Chris@16: || BOOST_WORKAROUND( __GNUC__, < 3) \ Chris@16: || (BOOST_WORKAROUND( _MSC_VER, <= 1300) ) \ Chris@16: ) \ Chris@16: && !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) Chris@16: # define USE_DATE_TIME_PRE_1_33_FACET_IO Chris@16: #endif Chris@16: Chris@16: Chris@16: // This file performs some local compiler configurations Chris@16: Chris@16: #include //set up locale configurations Chris@16: Chris@16: //Set up a configuration parameter for platforms that have Chris@16: //GetTimeOfDay Chris@16: #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME) Chris@16: #define BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK Chris@16: #endif Chris@16: Chris@16: // To Force no default constructors for date & ptime, un-comment following Chris@16: //#define DATE_TIME_NO_DEFAULT_CONSTRUCTOR Chris@16: Chris@16: // Include extensions to date_duration - comment out to remove this feature Chris@16: #define BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES Chris@16: // these extensions are known to cause problems with gcc295 Chris@16: #if defined(__GNUC__) && (__GNUC__ < 3) Chris@16: #undef BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES Chris@16: #endif Chris@16: Chris@16: #if (defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) || BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) ) Chris@16: #define BOOST_DATE_TIME_NO_MEMBER_INIT Chris@16: #endif Chris@16: Chris@16: // include these types before we try to re-define them Chris@16: #include Chris@16: Chris@16: //Define INT64_C for compilers that don't have it Chris@16: #if (!defined(INT64_C)) Chris@16: #define INT64_C(value) int64_t(value) Chris@16: #endif Chris@16: Chris@16: Chris@16: /* Workaround for Borland iterator error. Error was "Cannot convert 'istream *' to 'wistream *' in function istream_iterator<>::istream_iterator() */ Chris@16: #if defined(__BORLANDC__) && defined(BOOST_BCB_WITH_RW_LIB) Chris@16: #define BOOST_DATE_TIME_NO_WISTREAM_ITERATOR Chris@16: #endif Chris@16: Chris@16: Chris@16: // Borland v5.64 does not have the following in std namespace; v5.5.1 does Chris@16: #if defined(__BORLANDC__) && defined(BOOST_BCB_WITH_STLPORT) Chris@16: #include Chris@16: namespace std { Chris@16: using stlport::tolower; Chris@16: using stlport::ctype; Chris@16: using stlport::use_facet; Chris@16: } Chris@16: #endif Chris@16: Chris@16: // workaround for errors associated with output for date classes Chris@16: // modifications and input streaming for time classes. Chris@16: // Compilers affected are: Chris@16: // gcc295, msvc (neither with STLPort), any borland Chris@16: // Chris@16: #if (((defined(__GNUC__) && (__GNUC__ < 3)) || \ Chris@16: (defined(_MSC_VER) && (_MSC_VER < 1300)) ) && \ Chris@16: !defined(_STLP_OWN_IOSTREAMS) ) || \ Chris@16: BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) ) Chris@16: #define BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS Chris@16: #endif Chris@16: Chris@16: // The macro marks up places where compiler complains for missing return statement or Chris@16: // uninitialized variables after calling to boost::throw_exception. Chris@16: // BOOST_UNREACHABLE_RETURN doesn't work since even compilers that support Chris@16: // unreachable statements detection emit such warnings. Chris@16: #if defined(_MSC_VER) Chris@16: // Use special MSVC extension to markup unreachable code Chris@16: # define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) __assume(false) Chris@16: #elif !defined(BOOST_NO_UNREACHABLE_RETURN_DETECTION) Chris@16: // Call to a non-returning function should suppress the warning Chris@16: # if defined(BOOST_NO_STDC_NAMESPACE) Chris@16: namespace std { Chris@16: using ::abort; Chris@16: } Chris@16: # endif // defined(BOOST_NO_STDC_NAMESPACE) Chris@16: # define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) std::abort() Chris@16: #else Chris@16: // For other poor compilers the specified expression is compiled. Usually, this would be a return statement. Chris@16: # define BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(x) x Chris@16: #endif Chris@16: Chris@16: /* The following handles the definition of the necessary macros Chris@16: * for dll building on Win32 platforms. Chris@16: * Chris@16: * For code that will be placed in the date_time .dll, Chris@16: * it must be properly prefixed with BOOST_DATE_TIME_DECL. Chris@16: * The corresponding .cpp file must have BOOST_DATE_TIME_SOURCE Chris@16: * defined before including its header. For examples see: Chris@16: * greg_month.hpp & greg_month.cpp Chris@16: * Chris@16: */ Chris@16: Chris@16: // we need to import/export our code only if the user has specifically Chris@16: // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost Chris@16: // libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK Chris@16: // if they want just this one to be dynamically liked: Chris@16: #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) Chris@16: // export if this is our own source, otherwise import: Chris@16: # ifdef BOOST_DATE_TIME_SOURCE Chris@16: # define BOOST_DATE_TIME_DECL BOOST_SYMBOL_EXPORT Chris@16: # else Chris@16: # define BOOST_DATE_TIME_DECL BOOST_SYMBOL_IMPORT Chris@16: # endif // BOOST_DATE_TIME_SOURCE Chris@16: #endif // DYN_LINK Chris@16: // Chris@16: // if BOOST_WHATEVER_DECL isn't defined yet define it now: Chris@16: #ifndef BOOST_DATE_TIME_DECL Chris@16: # define BOOST_DATE_TIME_DECL Chris@16: #endif Chris@16: Chris@16: // Chris@16: // Automatically link to the correct build variant where possible. Chris@16: // Chris@16: #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_DATE_TIME_NO_LIB) && !defined(BOOST_DATE_TIME_SOURCE) Chris@16: // Chris@16: // Set the name of our library, this will get undef'ed by auto_link.hpp Chris@16: // once it's done with it: Chris@16: // Chris@16: #define BOOST_LIB_NAME boost_date_time Chris@16: // Chris@16: // If we're importing code from a dll, then tell auto_link.hpp about it: Chris@16: // Chris@16: #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) Chris@16: # define BOOST_DYN_LINK Chris@16: #endif Chris@16: // Chris@16: // And include the header that does the work: Chris@16: // Chris@16: #include Chris@16: #endif // auto-linking disabled Chris@16: Chris@16: #if defined(BOOST_HAS_THREADS) Chris@16: # if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) || defined(__BORLANDC__) Chris@16: //no reentrant posix functions (eg: localtime_r) Chris@16: # elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT))) Chris@16: # define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS Chris@16: # endif Chris@16: #endif Chris@16: Chris@16: Chris@16: #endif