1 /*=============================================================================
2 Boost.Wave: A Standard compliant C++ preprocessor library
4 Global application configuration
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 =============================================================================*/
13 #if !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
14 #define WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED
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>
22 ///////////////////////////////////////////////////////////////////////////////
23 // Define the maximal include nesting depth allowed. If this value isn't
24 // defined it defaults to 1024
26 // To define a new initial include nesting define the following constant
27 // before including this file.
29 #if !defined(BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH)
30 #define BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH 1024
33 ///////////////////////////////////////////////////////////////////////////////
34 // Decide, whether to support variadics and placemarkers
36 // To implement support variadics and placemarkers define the following to
37 // something not equal to zero.
39 #if !defined(BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS)
40 #define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
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)
47 // To disable the implementation of #warning directives, define the following
48 // constant as zero before including this file.
50 #if !defined(BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE)
51 #define BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE 1
54 ///////////////////////////////////////////////////////////////////////////////
55 // Decide, whether to implement #pragma once
57 // To disable the implementation of #pragma once, define the following
58 // constant as zero before including this file.
60 #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_ONCE)
61 #define BOOST_WAVE_SUPPORT_PRAGMA_ONCE 1
64 ///////////////////////////////////////////////////////////////////////////////
65 // Decide, whether to implement #pragma message("")
67 // To disable the implementation of #pragma message(""), define the following
68 // constant as zero before including this file.
70 #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE)
71 #define BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE 1
74 ///////////////////////////////////////////////////////////////////////////////
75 // Decide, whether to implement #include_next
76 // Please note, that this is an extension to the C++ Standard.
78 // To disable the implementation of #include_next, define the following
79 // constant as zero before including this file.
81 #if !defined(BOOST_WAVE_SUPPORT_INCLUDE_NEXT)
82 #define BOOST_WAVE_SUPPORT_INCLUDE_NEXT 1
85 ///////////////////////////////////////////////////////////////////////////////
86 // Decide, whether to support C++11
88 // To implement C++11 keywords and preprocessor semantics define the following
89 // to something not equal to zero.
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
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
103 // Note: By default this is enabled for Windows based systems, otherwise it's
105 #if !defined(BOOST_WAVE_SUPPORT_MS_EXTENSIONS)
106 #if defined(BOOST_WINDOWS)
107 #define BOOST_WAVE_SUPPORT_MS_EXTENSIONS 1
109 #define BOOST_WAVE_SUPPORT_MS_EXTENSIONS 0
113 ///////////////////////////////////////////////////////////////////////////////
114 // Allow the message body of the #error and #warning directives to be
115 // preprocessed before the diagnostic is issued.
117 // To disable preprocessing of the body of #error and #warning directives,
118 // define the following constant as zero before including this file.
120 #if !defined(BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY)
121 #define BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY 1
124 ///////////////////////////////////////////////////////////////////////////////
125 // Allow the #pragma directives to be returned to the caller (optionally after
126 // preprocessing the body)
128 // To disable the library to emit unknown #pragma directives, define the
129 // following constant as zero before including this file.
131 #if !defined(BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES)
132 #define BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES 1
135 ///////////////////////////////////////////////////////////////////////////////
136 // Allow the body of a #pragma directive to be preprocessed before the
137 // directive is returned to the caller.
139 // To disable the preprocessing of the body of #pragma directives, define the
140 // following constant as zero before including this file.
142 #if !defined(BOOST_WAVE_PREPROCESS_PRAGMA_BODY)
143 #define BOOST_WAVE_PREPROCESS_PRAGMA_BODY 1
146 ///////////////////////////////////////////////////////////////////////////////
147 // Allow to define macros with the command line syntax (-DMACRO(x)=definition)
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.
152 #if !defined(BOOST_WAVE_ENABLE_COMMANDLINE_MACROS)
153 #define BOOST_WAVE_ENABLE_COMMANDLINE_MACROS 1
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
161 // #pragma wave option [(argument)]
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"
172 ///////////////////////////////////////////////////////////////////////////////
173 // Configure Wave thread support, Boost.Spirit and Boost.Pool are configured
174 // based on these settings automatically
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'
180 #if !defined(BOOST_WAVE_SUPPORT_THREADING)
181 #if defined(BOOST_HAS_THREADS)
182 #define BOOST_WAVE_SUPPORT_THREADING 1
184 #define BOOST_WAVE_SUPPORT_THREADING 0
188 #if BOOST_WAVE_SUPPORT_THREADING != 0
189 #ifndef BOOST_SPIRIT_THREADSAFE
190 #define BOOST_SPIRIT_THREADSAFE
192 #define PHOENIX_THREADSAFE 1
194 // disable thread support in Boost.Pool
195 #define BOOST_NO_MT 1
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
202 #if !defined(BOOST_WAVE_STRINGTYPE)
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)
211 #define BOOST_WAVE_STRINGTYPE std::string
213 #if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING)
214 #define BOOST_WAVE_STRINGTYPE_USE_STDSTRING 1
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> \
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>
232 #endif // BOOST_WORKAROUND(__MWERKS__, < 0x3200) et.al.
233 #endif // !defined(BOOST_WAVE_STRINGTYPE)
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
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
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
251 ///////////////////////////////////////////////////////////////////////////////
252 // Debug flags for the Wave library, possible flags specified below.
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
264 #if !defined(BOOST_SPIRIT_DEBUG_FLAGS_CPP)
265 #define BOOST_SPIRIT_DEBUG_FLAGS_CPP 0 // default is no debugging
268 ///////////////////////////////////////////////////////////////////////////////
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.
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.
277 #if !defined(BOOST_WAVE_DUMP_PARSE_TREE)
278 #define BOOST_WAVE_DUMP_PARSE_TREE 0
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
284 ///////////////////////////////////////////////////////////////////////////////
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.
290 // To enable the output of the preprocessed expressions, define the following
291 // constant as something not equal to zero before including this file.
293 #if !defined(BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS)
294 #define BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS 0
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
301 ///////////////////////////////////////////////////////////////////////////////
302 // Decide, whether to use the separate compilation model for the instantiation
303 // of the C++ lexer objects.
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).
309 // To use the lexer inclusion model, define the following constant as
310 // something not equal to zero before including this file.
312 #if !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION)
313 #define BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION 1
316 ///////////////////////////////////////////////////////////////////////////////
317 // Decide, whether to use the separate compilation model for the instantiation
318 // of the grammar objects.
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.).
324 // To use the grammar inclusion model, define the following constant as
325 // something not equal to zero before including this file.
327 #if !defined(BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION)
328 #define BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION 1
331 ///////////////////////////////////////////////////////////////////////////////
332 // Decide whether to use a strict C++ lexer.
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.
338 // The default is to recognize the '$' character as part of identifiers.
340 #if !defined(BOOST_WAVE_USE_STRICT_LEXER)
341 #define BOOST_WAVE_USE_STRICT_LEXER 0
344 ///////////////////////////////////////////////////////////////////////////////
345 // Decide, whether the serialization of the wave::context class should be
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.
352 // To enable the availability of the serialization functionality, define the
353 // following constant as something not equal to zero before including this file.
355 #if !defined(BOOST_WAVE_SERIALIZATION)
356 #define BOOST_WAVE_SERIALIZATION 0
359 ///////////////////////////////////////////////////////////////////////////////
360 // Decide, whether the import keyword is recognized as such
362 // If this is defined to something not equal to zero the Wave will recognize
363 // import as a keyword (T_IMPORT token id)
365 #if !defined(BOOST_WAVE_SUPPORT_IMPORT_KEYWORD)
366 #define BOOST_WAVE_SUPPORT_IMPORT_KEYWORD 0
369 ///////////////////////////////////////////////////////////////////////////////
370 // Decide, whether to support long long integers in the preprocessor.
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')
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.
380 // This pp constant is effective only, if your target platform supports
381 // long long integers (BOOST_HAS_LONG_LONG is defined).
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
387 // Defining this pp constant enables the recognition of long long integers
388 // even if these do not have the 'll' suffix.
390 #if !defined(BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS)
391 #define BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS 0
394 namespace boost { namespace wave
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;
401 typedef long int_literal_type;
402 typedef unsigned long uint_literal_type;
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
412 // The default is to use std::numeric_limits<wchar_t>::is_signed.
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
418 #if !defined(BOOST_WAVE_WCHAR_T_SIGNEDNESS)
419 #define BOOST_WAVE_WCHAR_T_SIGNEDNESS BOOST_WAVE_WCHAR_T_AUTOSELECT
422 ///////////////////////////////////////////////////////////////////////////////
423 // Wave needs at least 4 parameters for phoenix actors
424 #if !defined(PHOENIX_LIMIT)
425 #define PHOENIX_LIMIT 6
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."
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)
438 #if defined(BOOST_WAVE_SOURCE)
439 #define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT
440 #define BOOST_WAVE_BUILD_DLL
442 #define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT
445 #endif // building a shared library
447 #ifndef BOOST_WAVE_DECL
448 #define BOOST_WAVE_DECL
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)
458 #define BOOST_LIB_NAME boost_wave
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
465 #include <boost/config/auto_link.hpp>
467 #endif // auto-linking disabled
468 #endif // BOOST_VERSION
470 ///////////////////////////////////////////////////////////////////////////////
471 // Compatibility macros
472 // (ensure interface compatibility to older Wave versions)
473 ///////////////////////////////////////////////////////////////////////////////
475 ///////////////////////////////////////////////////////////////////////////////
476 // The preprocessing hook signatures changed after the Boost V1.34.0 release
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.
482 // To force using the new interface define this constant to zero.
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
488 #define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 0
492 #endif // !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)