]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/wave/wave_config.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / wave / wave_config.hpp
1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
3
4 Global application configuration
5
6 http://www.boost.org/
7
8 Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
9 Software License, Version 1.0. (See accompanying file
10 LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 =============================================================================*/
12
13 #if !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
14 #define WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED
15
16 #include <boost/config.hpp>
17 #include <boost/detail/workaround.hpp>
18 #include <boost/version.hpp>
19 #include <boost/spirit/include/classic_version.hpp>
20 #include <boost/wave/wave_version.hpp>
21
22 ///////////////////////////////////////////////////////////////////////////////
23 // Define the maximal include nesting depth allowed. If this value isn't
24 // defined it defaults to 1024
25 //
26 // To define a new initial include nesting define the following constant
27 // before including this file.
28 //
29 #if !defined(BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH)
30 #define BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH 1024
31 #endif
32
33 ///////////////////////////////////////////////////////////////////////////////
34 // Decide, whether to support variadics and placemarkers
35 //
36 // To implement support variadics and placemarkers define the following to
37 // something not equal to zero.
38 //
39 #if !defined(BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS)
40 #define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
41 #endif
42
43 ///////////////////////////////////////////////////////////////////////////////
44 // Decide, whether to implement a #warning directive as an extension to the
45 // C++ Standard (same as #error, but emits a warning, not an error)
46 //
47 // To disable the implementation of #warning directives, define the following
48 // constant as zero before including this file.
49 //
50 #if !defined(BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE)
51 #define BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE 1
52 #endif
53
54 ///////////////////////////////////////////////////////////////////////////////
55 // Decide, whether to implement #pragma once
56 //
57 // To disable the implementation of #pragma once, define the following
58 // constant as zero before including this file.
59 //
60 #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_ONCE)
61 #define BOOST_WAVE_SUPPORT_PRAGMA_ONCE 1
62 #endif
63
64 ///////////////////////////////////////////////////////////////////////////////
65 // Decide, whether to implement #pragma message("")
66 //
67 // To disable the implementation of #pragma message(""), define the following
68 // constant as zero before including this file.
69 //
70 #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE)
71 #define BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE 1
72 #endif
73
74 ///////////////////////////////////////////////////////////////////////////////
75 // Decide, whether to implement #include_next
76 // Please note, that this is an extension to the C++ Standard.
77 //
78 // To disable the implementation of #include_next, define the following
79 // constant as zero before including this file.
80 //
81 #if !defined(BOOST_WAVE_SUPPORT_INCLUDE_NEXT)
82 #define BOOST_WAVE_SUPPORT_INCLUDE_NEXT 1
83 #endif
84
85 ///////////////////////////////////////////////////////////////////////////////
86 // Decide, whether to support C++11
87 //
88 // To implement C++11 keywords and preprocessor semantics define the following
89 // to something not equal to zero.
90 //
91 #if !defined(BOOST_WAVE_SUPPORT_CPP0X)
92 #define BOOST_WAVE_SUPPORT_CPP0X 1
93 #undef BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS
94 #define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
95 #endif
96
97 ///////////////////////////////////////////////////////////////////////////////
98 // Undefine the following, to enable some MS specific language extensions:
99 // __int8, __int16, __int32, __int64, __based, __declspec, __cdecl,
100 // __fastcall, __stdcall, __try, __except, __finally, __leave, __inline,
101 // __asm, #region, #endregion
102 //
103 // Note: By default this is enabled for Windows based systems, otherwise it's
104 // disabled.
105 #if !defined(BOOST_WAVE_SUPPORT_MS_EXTENSIONS)
106 #if defined(BOOST_WINDOWS)
107 #define BOOST_WAVE_SUPPORT_MS_EXTENSIONS 1
108 #else
109 #define BOOST_WAVE_SUPPORT_MS_EXTENSIONS 0
110 #endif
111 #endif
112
113 ///////////////////////////////////////////////////////////////////////////////
114 // Allow the message body of the #error and #warning directives to be
115 // preprocessed before the diagnostic is issued.
116 //
117 // To disable preprocessing of the body of #error and #warning directives,
118 // define the following constant as zero before including this file.
119 //
120 #if !defined(BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY)
121 #define BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY 1
122 #endif
123
124 ///////////////////////////////////////////////////////////////////////////////
125 // Allow the #pragma directives to be returned to the caller (optionally after
126 // preprocessing the body)
127 //
128 // To disable the library to emit unknown #pragma directives, define the
129 // following constant as zero before including this file.
130 //
131 #if !defined(BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES)
132 #define BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES 1
133 #endif
134
135 ///////////////////////////////////////////////////////////////////////////////
136 // Allow the body of a #pragma directive to be preprocessed before the
137 // directive is returned to the caller.
138 //
139 // To disable the preprocessing of the body of #pragma directives, define the
140 // following constant as zero before including this file.
141 //
142 #if !defined(BOOST_WAVE_PREPROCESS_PRAGMA_BODY)
143 #define BOOST_WAVE_PREPROCESS_PRAGMA_BODY 1
144 #endif
145
146 ///////////////////////////////////////////////////////////////////////////////
147 // Allow to define macros with the command line syntax (-DMACRO(x)=definition)
148 //
149 // To disable the possibility to define macros based on the command line
150 // syntax, define the following constant as zero before including this file.
151 //
152 #if !defined(BOOST_WAVE_ENABLE_COMMANDLINE_MACROS)
153 #define BOOST_WAVE_ENABLE_COMMANDLINE_MACROS 1
154 #endif
155
156 ///////////////////////////////////////////////////////////////////////////////
157 // Define the pragma keyword to be used by the library to recognize its own
158 // pragma's. If nothing else is defined, then 'wave' will be used as the
159 // default keyword, i.e. the library recognizes all
160 //
161 // #pragma wave option [(argument)]
162 //
163 // and dispatches the handling to the interpret_pragma() preprocessing hook
164 // function (see file: preprocessing_hooks.hpp). The arguments part of the
165 // pragma is optional.
166 // The BOOST_WAVE_PRAGMA_KEYWORD constant needs to be defined to
167 // resolve as a string literal value.
168 #if !defined(BOOST_WAVE_PRAGMA_KEYWORD)
169 #define BOOST_WAVE_PRAGMA_KEYWORD "wave"
170 #endif
171
172 ///////////////////////////////////////////////////////////////////////////////
173 // Configure Wave thread support, Boost.Spirit and Boost.Pool are configured
174 // based on these settings automatically
175 //
176 // If BOOST_WAVE_SUPPORT_THREADING is not defined, Wave will use the global
177 // Boost build settings (BOOST_HAS_THREADS), if it is defined its value
178 // defines, whether threading will be enabled or not (should be set to '0'
179 // or '1').
180 #if !defined(BOOST_WAVE_SUPPORT_THREADING)
181 #if defined(BOOST_HAS_THREADS)
182 #define BOOST_WAVE_SUPPORT_THREADING 1
183 #else
184 #define BOOST_WAVE_SUPPORT_THREADING 0
185 #endif
186 #endif
187
188 #if BOOST_WAVE_SUPPORT_THREADING != 0
189 #ifndef BOOST_SPIRIT_THREADSAFE
190 #define BOOST_SPIRIT_THREADSAFE
191 #endif
192 #define PHOENIX_THREADSAFE 1
193 #else
194 // disable thread support in Boost.Pool
195 #define BOOST_NO_MT 1
196 #endif
197
198 ///////////////////////////////////////////////////////////////////////////////
199 // Define the string type to be used to store the token values and the file
200 // names inside a file_position template class
201 //
202 #if !defined(BOOST_WAVE_STRINGTYPE)
203
204 // VC7 isn't able to compile the flex_string class, fall back to std::string
205 // CW up to 8.3 chokes as well *sigh*
206 // Tru64/CXX has linker problems when using flex_string
207 #if BOOST_WORKAROUND(__MWERKS__, < 0x3200) || \
208 (defined(__DECCXX) && defined(__alpha)) || \
209 defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING)
210
211 #define BOOST_WAVE_STRINGTYPE std::string
212
213 #if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING)
214 #define BOOST_WAVE_STRINGTYPE_USE_STDSTRING 1
215 #endif
216
217 #else
218
219 // use the following, if you have a fast std::allocator<char>
220 #define BOOST_WAVE_STRINGTYPE boost::wave::util::flex_string< \
221 char, std::char_traits<char>, std::allocator<char>, \
222 boost::wave::util::CowString< \
223 boost::wave::util::AllocatorStringStorage<char> \
224 > \
225 > \
226 /**/
227
228 // This include is needed for the flex_string class used in the
229 // BOOST_WAVE_STRINGTYPE above.
230 #include <boost/wave/util/flex_string.hpp>
231
232 #endif // BOOST_WORKAROUND(__MWERKS__, < 0x3200) et.al.
233 #endif // !defined(BOOST_WAVE_STRINGTYPE)
234
235 ///////////////////////////////////////////////////////////////////////////////
236 // The following definition forces the Spirit tree code to use list's instead
237 // of vectors, which may be more efficient on some platforms
238 // #define BOOST_SPIRIT_USE_LIST_FOR_TREES
239
240 ///////////////////////////////////////////////////////////////////////////////
241 // The following definition forces the Spirit tree code to use boost pool
242 // allocators instead of the std::allocator for the vector/list's.
243 // #define BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES
244
245 ///////////////////////////////////////////////////////////////////////////////
246 // Uncomment the following, if you need debug output, the
247 // BOOST_SPIRIT_DEBUG_FLAGS_CPP constants below help to fine control the
248 // amount of the generated debug output.
249 //#define BOOST_SPIRIT_DEBUG
250
251 ///////////////////////////////////////////////////////////////////////////////
252 // Debug flags for the Wave library, possible flags specified below.
253 //
254 // Note: These flags take effect only if the BOOST_SPIRIT_DEBUG constant
255 // above is defined as well.
256 #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_GRAMMAR 0x0001
257 #define BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION 0x0002
258 #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR 0x0004
259 #define BOOST_SPIRIT_DEBUG_FLAGS_INTLIT_GRAMMAR 0x0008
260 #define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010
261 #define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020
262 #define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040
263
264 #if !defined(BOOST_SPIRIT_DEBUG_FLAGS_CPP)
265 #define BOOST_SPIRIT_DEBUG_FLAGS_CPP 0 // default is no debugging
266 #endif
267
268 ///////////////////////////////////////////////////////////////////////////////
269 //
270 // For all recognized preprocessor statements the output parse trees
271 // formatted as xml are printed. The formatted parse trees are streamed to the
272 // std::ostream defined by the WAVE_DUMP_PARSE_TREE_OUT constant.
273 //
274 // To enable the output of these parse trees, define the following constant
275 // as zero something not equal to zero before including this file.
276 //
277 #if !defined(BOOST_WAVE_DUMP_PARSE_TREE)
278 #define BOOST_WAVE_DUMP_PARSE_TREE 0
279 #endif
280 #if BOOST_WAVE_DUMP_PARSE_TREE != 0 && !defined(BOOST_WAVE_DUMP_PARSE_TREE_OUT)
281 #define BOOST_WAVE_DUMP_PARSE_TREE_OUT std::cerr
282 #endif
283
284 ///////////////////////////////////////////////////////////////////////////////
285 //
286 // For all #if and #elif directives the preprocessed expressions are printed.
287 // These expressions are streamed to the std::ostream defined by the
288 // BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT constant.
289 //
290 // To enable the output of the preprocessed expressions, define the following
291 // constant as something not equal to zero before including this file.
292 //
293 #if !defined(BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS)
294 #define BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS 0
295 #endif
296 #if BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS != 0 && \
297 !defined(BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT)
298 #define BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT std::cerr
299 #endif
300
301 ///////////////////////////////////////////////////////////////////////////////
302 // Decide, whether to use the separate compilation model for the instantiation
303 // of the C++ lexer objects.
304 //
305 // If this is defined, you should explicitly instantiate the C++ lexer
306 // template with the correct parameters in a separate compilation unit of
307 // your program (see the file instantiate_re2c_lexer.cpp).
308 //
309 // To use the lexer inclusion model, define the following constant as
310 // something not equal to zero before including this file.
311 //
312 #if !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION)
313 #define BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION 1
314 #endif
315
316 ///////////////////////////////////////////////////////////////////////////////
317 // Decide, whether to use the separate compilation model for the instantiation
318 // of the grammar objects.
319 //
320 // If this is defined, you should explicitly instantiate the grammar
321 // templates with the correct parameters in a separate compilation unit of
322 // your program (see the files instantiate_cpp_grammar.cpp et.al.).
323 //
324 // To use the grammar inclusion model, define the following constant as
325 // something not equal to zero before including this file.
326 //
327 #if !defined(BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION)
328 #define BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION 1
329 #endif
330
331 ///////////////////////////////////////////////////////////////////////////////
332 // Decide whether to use a strict C++ lexer.
333 //
334 // If this is defined to something != 0, then the C++ lexers recognize the
335 // strict C99/C++ basic source character set. If it is not defined or defined
336 // to zero, the C++ lexers recognize the '$' character as part of identifiers.
337 //
338 // The default is to recognize the '$' character as part of identifiers.
339 //
340 #if !defined(BOOST_WAVE_USE_STRICT_LEXER)
341 #define BOOST_WAVE_USE_STRICT_LEXER 0
342 #endif
343
344 ///////////////////////////////////////////////////////////////////////////////
345 // Decide, whether the serialization of the wave::context class should be
346 // supported
347 //
348 // If this is defined to something not equal to zero the generated code will
349 // expose routines allowing to store and reload the internal state of the
350 // wave::context object.
351 //
352 // To enable the availability of the serialization functionality, define the
353 // following constant as something not equal to zero before including this file.
354 //
355 #if !defined(BOOST_WAVE_SERIALIZATION)
356 #define BOOST_WAVE_SERIALIZATION 0
357 #endif
358
359 ///////////////////////////////////////////////////////////////////////////////
360 // Decide, whether the import keyword is recognized as such
361 //
362 // If this is defined to something not equal to zero the Wave will recognize
363 // import as a keyword (T_IMPORT token id)
364 //
365 #if !defined(BOOST_WAVE_SUPPORT_IMPORT_KEYWORD)
366 #define BOOST_WAVE_SUPPORT_IMPORT_KEYWORD 0
367 #endif
368
369 ///////////////////////////////////////////////////////////////////////////////
370 // Decide, whether to support long long integers in the preprocessor.
371 //
372 // The C++ standard requires the preprocessor to use one of the following
373 // types for integer literals: long or unsigned long depending on an optional
374 // suffix ('u', 'l', 'ul', or 'lu')
375 //
376 // Sometimes it's required to preprocess integer literals bigger than that
377 // (i.e. long long or unsigned long long). In this case you need to define the
378 // BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS to something not equal to zero.
379 //
380 // This pp constant is effective only, if your target platform supports
381 // long long integers (BOOST_HAS_LONG_LONG is defined).
382 //
383 // Please note, that this setting doesn't relate to the Wave support option
384 // support_option_long_long, which enables the recognition of 'll' suffixes
385 // only.
386 //
387 // Defining this pp constant enables the recognition of long long integers
388 // even if these do not have the 'll' suffix.
389 //
390 #if !defined(BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS)
391 #define BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS 0
392 #endif
393
394 namespace boost { namespace wave
395 {
396 #if defined(BOOST_HAS_LONG_LONG) && \
397 BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS != 0
398 typedef boost::long_long_type int_literal_type;
399 typedef boost::ulong_long_type uint_literal_type;
400 #else
401 typedef long int_literal_type;
402 typedef unsigned long uint_literal_type;
403 #endif
404 }}
405
406 ///////////////////////////////////////////////////////////////////////////////
407 // On some platforms Wave will not be able to properly detect whether wchar_t
408 // is representing a signed or unsigned integral data type. Use the
409 // configuration constants below to force wchar_t being signed or unsigned, as
410 // appropriate.
411 //
412 // The default is to use std::numeric_limits<wchar_t>::is_signed.
413
414 #define BOOST_WAVE_WCHAR_T_AUTOSELECT 1
415 #define BOOST_WAVE_WCHAR_T_FORCE_SIGNED 2
416 #define BOOST_WAVE_WCHAR_T_FORCE_UNSIGNED 3
417
418 #if !defined(BOOST_WAVE_WCHAR_T_SIGNEDNESS)
419 #define BOOST_WAVE_WCHAR_T_SIGNEDNESS BOOST_WAVE_WCHAR_T_AUTOSELECT
420 #endif
421
422 ///////////////////////////////////////////////////////////////////////////////
423 // Wave needs at least 4 parameters for phoenix actors
424 #if !defined(PHOENIX_LIMIT)
425 #define PHOENIX_LIMIT 6
426 #endif
427 #if PHOENIX_LIMIT < 6
428 // boost/home/classic/spirit/classic_attribute.hpp sets PHOENIX_LIMIT to 3!
429 #error "Boost.Wave: the constant PHOENIX_LIMIT must be at least defined to 6" \
430 " to compile the library."
431 #endif
432
433 ///////////////////////////////////////////////////////////////////////////////
434 // Set up dll import/export options
435 #if (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \
436 !defined(BOOST_WAVE_STATIC_LINK)
437
438 #if defined(BOOST_WAVE_SOURCE)
439 #define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT
440 #define BOOST_WAVE_BUILD_DLL
441 #else
442 #define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT
443 #endif
444
445 #endif // building a shared library
446
447 #ifndef BOOST_WAVE_DECL
448 #define BOOST_WAVE_DECL
449 #endif
450
451 ///////////////////////////////////////////////////////////////////////////////
452 // Auto library naming
453 #if BOOST_VERSION >= 103100
454 // auto link features work beginning from Boost V1.31.0
455 #if !defined(BOOST_WAVE_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \
456 !defined(BOOST_WAVE_NO_LIB)
457
458 #define BOOST_LIB_NAME boost_wave
459
460 // tell the auto-link code to select a dll when required:
461 #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_WAVE_DYN_LINK)
462 #define BOOST_DYN_LINK
463 #endif
464
465 #include <boost/config/auto_link.hpp>
466
467 #endif // auto-linking disabled
468 #endif // BOOST_VERSION
469
470 ///////////////////////////////////////////////////////////////////////////////
471 // Compatibility macros
472 // (ensure interface compatibility to older Wave versions)
473 ///////////////////////////////////////////////////////////////////////////////
474
475 ///////////////////////////////////////////////////////////////////////////////
476 // The preprocessing hook signatures changed after the Boost V1.34.0 release
477 //
478 // To use the preprocessing hook signatures as released with Boost V1.34.0
479 // you need to define the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS
480 // constant to something not equal zero.
481 //
482 // To force using the new interface define this constant to zero.
483 //
484 #if !defined(BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS)
485 #if BOOST_VERSION < 103500 // before Boost V1.35.0
486 #define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 1
487 #else
488 #define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 0
489 #endif
490 #endif
491
492 #endif // !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)