| 1 | #ifndef DATE_TIME_COMPILER_CONFIG_HPP___ | 
|---|
| 2 | #define DATE_TIME_COMPILER_CONFIG_HPP___ | 
|---|
| 3 |  | 
|---|
| 4 | /* Copyright (c) 2002-2004 CrystalClear Software, Inc. | 
|---|
| 5 |  * Subject to the Boost Software License, Version 1.0. (See accompanying | 
|---|
| 6 |  * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) | 
|---|
| 7 |  * Author: Jeff Garland, Bart Garst | 
|---|
| 8 |  * $Date: 2005/08/02 13:52:44 $ | 
|---|
| 9 |  */ | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 | // With boost release 1.33, date_time will be using a different, | 
|---|
| 13 | // more flexible, IO system. This new system is not compatible with | 
|---|
| 14 | // old compilers. The original date_time IO system remains for those  | 
|---|
| 15 | // compilers. They must define this macro to use the legacy IO. | 
|---|
| 16 | #if ((defined(__GNUC__) && (__GNUC__ < 3))                    || \ | 
|---|
| 17 |      (defined(_MSC_VER) && (_MSC_VER <= 1300) )               || \ | 
|---|
| 18 |      (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0564) ) )   && \ | 
|---|
| 19 |     !defined(USE_DATE_TIME_PRE_1_33_FACET_IO) | 
|---|
| 20 | #define USE_DATE_TIME_PRE_1_33_FACET_IO | 
|---|
| 21 | #endif | 
|---|
| 22 |  | 
|---|
| 23 |  | 
|---|
| 24 | // This file performs some local compiler configurations | 
|---|
| 25 |  | 
|---|
| 26 | #include "boost/date_time/locale_config.hpp" //set up locale configurations | 
|---|
| 27 |  | 
|---|
| 28 | //Set up a configuration parameter for platforms that have  | 
|---|
| 29 | //GetTimeOfDay | 
|---|
| 30 | #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME) | 
|---|
| 31 | #define BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK | 
|---|
| 32 | #endif | 
|---|
| 33 |  | 
|---|
| 34 | // To Force no default constructors for date & ptime, un-comment following | 
|---|
| 35 | //#define DATE_TIME_NO_DEFAULT_CONSTRUCTOR | 
|---|
| 36 |  | 
|---|
| 37 | // Include extensions to date_duration - comment out to remove this feature | 
|---|
| 38 | #define BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES | 
|---|
| 39 | // these extensions are known to cause problems with gcc295 | 
|---|
| 40 | #if defined(__GNUC__) && (__GNUC__ < 3) | 
|---|
| 41 | #undef BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES | 
|---|
| 42 | #endif | 
|---|
| 43 |  | 
|---|
| 44 | #if (defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) || (defined(__BORLANDC__))) | 
|---|
| 45 | #define BOOST_DATE_TIME_NO_MEMBER_INIT | 
|---|
| 46 | #endif | 
|---|
| 47 |  | 
|---|
| 48 | // include these types before we try to re-define them | 
|---|
| 49 | #include "boost/cstdint.hpp" | 
|---|
| 50 |  | 
|---|
| 51 | //Define INT64_C for compilers that don't have it | 
|---|
| 52 | #if (!defined(INT64_C)) | 
|---|
| 53 | #define INT64_C(value)  int64_t(value) | 
|---|
| 54 | #endif | 
|---|
| 55 |  | 
|---|
| 56 |  | 
|---|
| 57 | /* Workaround for Borland iterator error. Error was "Cannot convert 'istream *' to 'wistream *' in function istream_iterator<>::istream_iterator() */ | 
|---|
| 58 | #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551) | 
|---|
| 59 | #define BOOST_DATE_TIME_NO_WISTREAM_ITERATOR | 
|---|
| 60 | #endif | 
|---|
| 61 |  | 
|---|
| 62 |  | 
|---|
| 63 | // Borland v5.64 does not have the following in std namespace; v5.5.1 does | 
|---|
| 64 | #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x0564)  | 
|---|
| 65 | #include <locale> | 
|---|
| 66 | namespace std { | 
|---|
| 67 |   using stlport::tolower; | 
|---|
| 68 |   using stlport::ctype; | 
|---|
| 69 |   using stlport::use_facet; | 
|---|
| 70 | } | 
|---|
| 71 | #endif | 
|---|
| 72 |  | 
|---|
| 73 | // workaround for errors associated with output for date classes  | 
|---|
| 74 | // modifications and input streaming for time classes.  | 
|---|
| 75 | // Compilers affected are: | 
|---|
| 76 | // gcc295, msvc (neither with STLPort), any borland | 
|---|
| 77 | //  | 
|---|
| 78 | #if (((defined(__GNUC__) && (__GNUC__ < 3)) || \ | 
|---|
| 79 |       (defined(_MSC_VER) && (_MSC_VER <= 1200)) ) && \ | 
|---|
| 80 |       !defined(_STLP_OWN_IOSTREAMS) ) || \ | 
|---|
| 81 |        defined(__BORLANDC__) | 
|---|
| 82 | #define BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS | 
|---|
| 83 | #endif | 
|---|
| 84 |  | 
|---|
| 85 | /* The following handles the definition of the necessary macros | 
|---|
| 86 |  * for dll building on Win32 platforms. | 
|---|
| 87 |  *  | 
|---|
| 88 |  * For code that will be placed in the date_time .dll,  | 
|---|
| 89 |  * it must be properly prefixed with BOOST_DATE_TIME_DECL. | 
|---|
| 90 |  * The corresponding .cpp file must have BOOST_DATE_TIME_SOURCES | 
|---|
| 91 |  * defined before including its header. For examples see: | 
|---|
| 92 |  * greg_month.hpp & greg_month.cpp | 
|---|
| 93 |  *  | 
|---|
| 94 |  */ | 
|---|
| 95 |  | 
|---|
| 96 | #ifdef BOOST_HAS_DECLSPEC // defined in config system | 
|---|
| 97 |    // we need to import/export our code only if the user has specifically | 
|---|
| 98 |    // asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost | 
|---|
| 99 |    // libraries to be dynamically linked, or BOOST_DATE_TIME_DYN_LINK | 
|---|
| 100 |    // if they want just this one to be dynamically liked: | 
|---|
| 101 | #  if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) | 
|---|
| 102 |       // export if this is our own source, otherwise import: | 
|---|
| 103 | #     ifdef BOOST_DATE_TIME_SOURCE | 
|---|
| 104 | #       define BOOST_DATE_TIME_DECL __declspec(dllexport) | 
|---|
| 105 | #     else | 
|---|
| 106 | #       define BOOST_DATE_TIME_DECL __declspec(dllimport) | 
|---|
| 107 | #     endif  // BOOST_DATE_TIME_SOURCE | 
|---|
| 108 | #  endif  // DYN_LINK | 
|---|
| 109 | #endif  // BOOST_HAS_DECLSPEC | 
|---|
| 110 | // | 
|---|
| 111 | // if BOOST_WHATEVER_DECL isn't defined yet define it now: | 
|---|
| 112 | #ifndef BOOST_DATE_TIME_DECL | 
|---|
| 113 | #  define BOOST_DATE_TIME_DECL | 
|---|
| 114 | #endif | 
|---|
| 115 |  | 
|---|
| 116 | // | 
|---|
| 117 | // Automatically link to the correct build variant where possible.  | 
|---|
| 118 | //  | 
|---|
| 119 | #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_DATE_TIME_NO_LIB) && !defined(BOOST_DATE_TIME_SOURCE) | 
|---|
| 120 | // | 
|---|
| 121 | // Set the name of our library, this will get undef'ed by auto_link.hpp | 
|---|
| 122 | // once it's done with it: | 
|---|
| 123 | // | 
|---|
| 124 | #define BOOST_LIB_NAME boost_date_time | 
|---|
| 125 | // | 
|---|
| 126 | // If we're importing code from a dll, then tell auto_link.hpp about it: | 
|---|
| 127 | // | 
|---|
| 128 | #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_DATE_TIME_DYN_LINK) | 
|---|
| 129 | #  define BOOST_DYN_LINK | 
|---|
| 130 | #endif | 
|---|
| 131 | // | 
|---|
| 132 | // And include the header that does the work: | 
|---|
| 133 | // | 
|---|
| 134 | #include <boost/config/auto_link.hpp> | 
|---|
| 135 | #endif  // auto-linking disabled | 
|---|
| 136 |  | 
|---|
| 137 | #if defined(BOOST_HAS_THREADS)  | 
|---|
| 138 | #  if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) ||  defined(__BORLANDC__) | 
|---|
| 139 |      //no reentrant posix functions (eg: localtime_r) | 
|---|
| 140 | #  else | 
|---|
| 141 | #   define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS | 
|---|
| 142 | #  endif | 
|---|
| 143 | #endif | 
|---|
| 144 |  | 
|---|
| 145 |  | 
|---|
| 146 | #endif | 
|---|