~ubuntu-branches/ubuntu/saucy/deal.ii/saucy

« back to all changes in this revision

Viewing changes to contrib/boost/include/boost/detail/workaround.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2009-05-08 23:13:50 UTC
  • Revision ID: james.westby@ubuntu.com-20090508231350-rrh1ltgi0tifabwc
Tags: upstream-6.2.0
ImportĀ upstreamĀ versionĀ 6.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright David Abrahams 2002.
 
2
// Distributed under the Boost Software License, Version 1.0. (See
 
3
// accompanying file LICENSE_1_0.txt or copy at
 
4
// http://www.boost.org/LICENSE_1_0.txt)
 
5
#ifndef WORKAROUND_DWA2002126_HPP
 
6
# define WORKAROUND_DWA2002126_HPP
 
7
 
 
8
// Compiler/library version workaround macro
 
9
//
 
10
// Usage:
 
11
//
 
12
//     #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
 
13
//        // workaround for eVC4 and VC6
 
14
//        ... // workaround code here
 
15
//     #endif
 
16
//
 
17
// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the
 
18
// first argument must be undefined or expand to a numeric
 
19
// value. The above expands to:
 
20
//
 
21
//     (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300
 
22
//
 
23
// When used for workarounds that apply to the latest known version 
 
24
// and all earlier versions of a compiler, the following convention 
 
25
// should be observed:
 
26
//
 
27
//     #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301))
 
28
//
 
29
// The version number in this case corresponds to the last version in
 
30
// which the workaround was known to have been required. When
 
31
// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro
 
32
// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates
 
33
// the workaround for any version of the compiler. When
 
34
// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or
 
35
// error will be issued if the compiler version exceeds the argument
 
36
// to BOOST_TESTED_AT().  This can be used to locate workarounds which
 
37
// may be obsoleted by newer versions.
 
38
 
 
39
# ifndef BOOST_STRICT_CONFIG
 
40
 
 
41
#include <boost/config.hpp>
 
42
 
 
43
#ifndef __BORLANDC__
 
44
#define __BORLANDC___WORKAROUND_GUARD 1
 
45
#else
 
46
#define __BORLANDC___WORKAROUND_GUARD 0
 
47
#endif
 
48
#ifndef __MSC_VER
 
49
#define __MSC_VER_WORKAROUND_GUARD 1
 
50
#else
 
51
#define __MSC_VER_WORKAROUND_GUARD 0
 
52
#endif
 
53
#ifndef _MSC_FULL_VER
 
54
#define _MSC_FULL_VER_WORKAROUND_GUARD 1
 
55
#else
 
56
#define _MSC_FULL_VER_WORKAROUND_GUARD 0
 
57
#endif
 
58
#ifndef BOOST_MSVC
 
59
#define BOOST_MSVC_WORKAROUND_GUARD 1
 
60
#else
 
61
#define BOOST_MSVC_WORKAROUND_GUARD 0
 
62
#endif
 
63
#ifndef __GNUC__
 
64
#define __GNUC___WORKAROUND_GUARD 1
 
65
#else
 
66
#define __GNUC___WORKAROUND_GUARD 0
 
67
#endif
 
68
#ifndef __GNUC_MINOR__
 
69
#define __GNUC_MINOR___WORKAROUND_GUARD 1
 
70
#else
 
71
#define __GNUC_MINOR___WORKAROUND_GUARD 0
 
72
#endif
 
73
#ifndef __GNUC_PATCHLEVEL__
 
74
#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1
 
75
#else
 
76
#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0
 
77
#endif
 
78
#ifndef __IBMCPP__
 
79
#define __IBMCPP___WORKAROUND_GUARD 1
 
80
#else
 
81
#define __IBMCPP___WORKAROUND_GUARD 0
 
82
#endif
 
83
#ifndef __SUNPRO_CC
 
84
#define __SUNPRO_CC_WORKAROUND_GUARD 1
 
85
#else
 
86
#define __SUNPRO_CC_WORKAROUND_GUARD 0
 
87
#endif
 
88
#ifndef __DECCXX_VER
 
89
#define __DECCXX_VER_WORKAROUND_GUARD 1
 
90
#else
 
91
#define __DECCXX_VER_WORKAROUND_GUARD 0
 
92
#endif
 
93
#ifndef __MWERKS__
 
94
#define __MWERKS___WORKAROUND_GUARD 1
 
95
#else
 
96
#define __MWERKS___WORKAROUND_GUARD 0
 
97
#endif
 
98
#ifndef __EDG_VERSION__
 
99
#define __EDG_VERSION___WORKAROUND_GUARD 1
 
100
#else
 
101
#define __EDG_VERSION___WORKAROUND_GUARD 0
 
102
#endif
 
103
#ifndef __HP_aCC
 
104
#define __HP_aCC_WORKAROUND_GUARD 1
 
105
#else
 
106
#define __HP_aCC_WORKAROUND_GUARD 0
 
107
#endif
 
108
#ifndef _CRAYC
 
109
#define _CRAYC_WORKAROUND_GUARD 1
 
110
#else
 
111
#define _CRAYC_WORKAROUND_GUARD 0
 
112
#endif
 
113
#ifndef __DMC__
 
114
#define __DMC___WORKAROUND_GUARD 1
 
115
#else
 
116
#define __DMC___WORKAROUND_GUARD 0
 
117
#endif
 
118
#ifndef MPW_CPLUS
 
119
#define MPW_CPLUS_WORKAROUND_GUARD 1
 
120
#else
 
121
#define MPW_CPLUS_WORKAROUND_GUARD 0
 
122
#endif
 
123
 
 
124
#ifndef _RWSTD_VER
 
125
#define _RWSTD_VER_WORKAROUND_GUARD 1
 
126
#else
 
127
#define _RWSTD_VER_WORKAROUND_GUARD 0
 
128
#endif
 
129
#ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
 
130
#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1
 
131
#else
 
132
#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0
 
133
#endif
 
134
#ifndef __SGI_STL_PORT
 
135
#define __SGI_STL_PORT_WORKAROUND_GUARD 1
 
136
#else
 
137
#define __SGI_STL_PORT_WORKAROUND_GUARD 0
 
138
#endif
 
139
#ifndef _STLPORT_VERSION
 
140
#define _STLPORT_VERSION_WORKAROUND_GUARD 1
 
141
#else
 
142
#define _STLPORT_VERSION_WORKAROUND_GUARD 0
 
143
#endif
 
144
 
 
145
#ifndef BOOST_INTEL_CXX_VERSION
 
146
#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1
 
147
#else
 
148
#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0
 
149
#endif
 
150
#ifndef BOOST_INTEL_WIN
 
151
#define BOOST_INTEL_WIN_WORKAROUND_GUARD 1
 
152
#else
 
153
#define BOOST_INTEL_WIN_WORKAROUND_GUARD 0
 
154
#endif
 
155
#ifndef BOOST_DINKUMWARE_STDLIB
 
156
#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1
 
157
#else
 
158
#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0
 
159
#endif
 
160
#ifndef BOOST_INTEL
 
161
#define BOOST_INTEL_WORKAROUND_GUARD 1
 
162
#else
 
163
#define BOOST_INTEL_WORKAROUND_GUARD 0
 
164
#endif
 
165
// Always define to zero, if it's used it'll be defined my MPL:
 
166
#define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0
 
167
 
 
168
#  define BOOST_WORKAROUND(symbol, test)                \
 
169
         ((symbol ## _WORKAROUND_GUARD + 0 == 0) &&     \
 
170
         (symbol != 0) && (1 % (( (symbol test) ) + 1)))
 
171
//                              ^ ^           ^ ^
 
172
// The extra level of parenthesis nesting above, along with the
 
173
// BOOST_OPEN_PAREN indirection below, is required to satisfy the
 
174
// broken preprocessor in MWCW 8.3 and earlier.
 
175
//
 
176
// The basic mechanism works as follows:
 
177
//      (symbol test) + 1        =>   if (symbol test) then 2 else 1
 
178
//      1 % ((symbol test) + 1)  =>   if (symbol test) then 1 else 0
 
179
//
 
180
// The complication with % is for cooperation with BOOST_TESTED_AT().
 
181
// When "test" is BOOST_TESTED_AT(x) and
 
182
// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined,
 
183
//
 
184
//      symbol test              =>   if (symbol <= x) then 1 else -1
 
185
//      (symbol test) + 1        =>   if (symbol <= x) then 2 else 0
 
186
//      1 % ((symbol test) + 1)  =>   if (symbol <= x) then 1 else divide-by-zero
 
187
//
 
188
 
 
189
#  ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS
 
190
#   define BOOST_OPEN_PAREN (
 
191
#   define BOOST_TESTED_AT(value)  > value) ?(-1): BOOST_OPEN_PAREN 1
 
192
#  else
 
193
#   define BOOST_TESTED_AT(value) != ((value)-(value))
 
194
#  endif
 
195
 
 
196
# else
 
197
 
 
198
#  define BOOST_WORKAROUND(symbol, test) 0
 
199
 
 
200
# endif 
 
201
 
 
202
#endif // WORKAROUND_DWA2002126_HPP