Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/date_time/compiler_config.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

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