blob: c56dff225c366f63c6d0db1463f3fb2e1f131ade [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (C) Copyright John Maddock 2001.
2// (C) Copyright Jens Maurer 2001.
3// Use, modification and distribution are subject to the
4// Boost Software License, Version 1.0. (See accompanying file
5// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7// See http://www.boost.org for most recent version.
8
9// config for libstdc++ v3
10// not much to go in here:
11
12#define BOOST_GNU_STDLIB 1
13
14#ifdef __GLIBCXX__
15#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
16#else
17#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
18#endif
19
20#if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
21# define BOOST_NO_CWCHAR
22# define BOOST_NO_CWCTYPE
23# define BOOST_NO_STD_WSTRING
24# define BOOST_NO_STD_WSTREAMBUF
25#endif
26
27#if defined(__osf__) && !defined(_REENTRANT) \
28 && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
29// GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
30// file is included, therefore for consistency we define it here as well.
31# define _REENTRANT
32#endif
33
34#ifdef __GLIBCXX__ // gcc 3.4 and greater:
35# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
36 || defined(_GLIBCXX__PTHREADS) \
37 || defined(_GLIBCXX_HAS_GTHREADS) \
38 || defined(_WIN32)
39 //
40 // If the std lib has thread support turned on, then turn it on in Boost
41 // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
42 // while others do not...
43 //
44# define BOOST_HAS_THREADS
45# else
46# define BOOST_DISABLE_THREADS
47# endif
48#elif defined(__GLIBCPP__) \
49 && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
50 && !defined(_GLIBCPP__PTHREADS)
51 // disable thread support if the std lib was built single threaded:
52# define BOOST_DISABLE_THREADS
53#endif
54
55#if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
56// linux on arm apparently doesn't define _REENTRANT
57// so just turn on threading support whenever the std lib is thread safe:
58# define BOOST_HAS_THREADS
59#endif
60
61#if !defined(_GLIBCPP_USE_LONG_LONG) \
62 && !defined(_GLIBCXX_USE_LONG_LONG)\
63 && defined(BOOST_HAS_LONG_LONG)
64// May have been set by compiler/*.hpp, but "long long" without library
65// support is useless.
66# undef BOOST_HAS_LONG_LONG
67#endif
68
69// Apple doesn't seem to reliably defined a *unix* macro
70#if !defined(CYGWIN) && ( defined(__unix__) \
71 || defined(__unix) \
72 || defined(unix) \
73 || defined(__APPLE__) \
74 || defined(__APPLE) \
75 || defined(APPLE))
76# include <unistd.h>
77#endif
78
79#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
80# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
81# define BOOST_HAS_SLIST
82# define BOOST_HAS_HASH
83# define BOOST_SLIST_HEADER <ext/slist>
84# if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
85# define BOOST_HASH_SET_HEADER <ext/hash_set>
86# define BOOST_HASH_MAP_HEADER <ext/hash_map>
87# else
88# define BOOST_HASH_SET_HEADER <backward/hash_set>
89# define BOOST_HASH_MAP_HEADER <backward/hash_map>
90# endif
91#endif
92
93// stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
94// __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
95// developers. He also commented:
96//
97// "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
98// GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
99// Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
100// than any release in the 4.2 series."
101//
102// Another resource for understanding stdlibc++ features is:
103// http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
104
105// C++0x headers in GCC 4.3.0 and later
106//
107#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
108# define BOOST_NO_CXX11_HDR_ARRAY
109# define BOOST_NO_CXX11_HDR_REGEX
110# define BOOST_NO_CXX11_HDR_TUPLE
111# define BOOST_NO_CXX11_HDR_UNORDERED_MAP
112# define BOOST_NO_CXX11_HDR_UNORDERED_SET
113# define BOOST_NO_CXX11_HDR_FUNCTIONAL
114#endif
115
116// C++0x headers in GCC 4.4.0 and later
117//
118#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
119# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
120# define BOOST_NO_CXX11_HDR_FORWARD_LIST
121# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
122# define BOOST_NO_CXX11_HDR_MUTEX
123# define BOOST_NO_CXX11_HDR_RATIO
124# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
125# define BOOST_NO_CXX11_SMART_PTR
126#else
127# define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
128# define BOOST_HAS_TR1_COMPLEX_OVERLOADS
129#endif
130
131#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_CXX11_HDR_MUTEX))
132# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
133# define BOOST_NO_CXX11_HDR_MUTEX
134#endif
135
136// C++0x features in GCC 4.5.0 and later
137//
138#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
139# define BOOST_NO_CXX11_NUMERIC_LIMITS
140# define BOOST_NO_CXX11_HDR_FUTURE
141# define BOOST_NO_CXX11_HDR_RANDOM
142#endif
143
144// C++0x features in GCC 4.6.0 and later
145//
146#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
147# define BOOST_NO_CXX11_HDR_TYPEINDEX
148#endif
149
150// C++0x features in GCC 4.7.0 and later
151//
152#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
153// Note that although <chrono> existed prior to 4.7, "stead_clock" is spelled "monotonic_clock"
154// so 4.7.0 is the first truely conforming one.
155# define BOOST_NO_CXX11_HDR_CHRONO
156# define BOOST_NO_CXX11_ALLOCATOR
157#endif
158// C++0x headers not yet (fully!) implemented
159//
160# define BOOST_NO_CXX11_HDR_THREAD
161# define BOOST_NO_CXX11_HDR_TYPE_TRAITS
162# define BOOST_NO_CXX11_HDR_CODECVT
163# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
164
165// --- end ---