Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:02:23

0001 /*=============================================================================
0002     Boost.Wave: A Standard compliant C++ preprocessor library
0003     Definition of the various language support constants
0004 
0005     http://www.boost.org/
0006 
0007     Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
0008     Software License, Version 1.0. (See accompanying file
0009     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0010 =============================================================================*/
0011 #if !defined(BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)
0012 #define BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED
0013 
0014 #include <boost/wave/wave_config.hpp>
0015 
0016 // this must occur after all of the includes and before any code appears
0017 #ifdef BOOST_HAS_ABI_HEADERS
0018 #include BOOST_ABI_PREFIX
0019 #endif
0020 
0021 ///////////////////////////////////////////////////////////////////////////////
0022 namespace boost {
0023 namespace wave {
0024 
0025 enum language_support {
0026     //  support flags for C++98
0027     support_normal = 0x01,
0028     support_cpp = support_normal,
0029 
0030     support_option_long_long = 0x02,
0031 
0032 #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
0033     //  support flags for C99
0034     support_option_variadics = 0x04,
0035     support_c99 = support_option_variadics | support_option_long_long | 0x08,
0036 #endif
0037 #if BOOST_WAVE_SUPPORT_CPP0X != 0
0038     //  support flags for C++11
0039     support_option_no_newline_at_end_of_file = 0x20,
0040 
0041     support_cpp0x = support_option_variadics | support_option_long_long |
0042         support_option_no_newline_at_end_of_file | 0x10,
0043     support_cpp11 = support_cpp0x,
0044 #if BOOST_WAVE_SUPPORT_CPP1Z != 0
0045     // support flags for C++17
0046     support_option_has_include = 0x10000,
0047 
0048     support_cpp1z = support_option_variadics | support_option_long_long |
0049         support_option_no_newline_at_end_of_file | support_option_has_include |
0050         0x20000,
0051     support_cpp17 = support_cpp1z,
0052 #if BOOST_WAVE_SUPPORT_CPP2A != 0
0053     //  support flags for C++20
0054     support_option_va_opt = 0x40000,
0055 
0056     support_cpp2a = support_option_variadics | support_option_long_long |
0057         support_option_no_newline_at_end_of_file | support_option_has_include |
0058         support_option_va_opt | 0x80000,
0059     support_cpp20 = support_cpp2a,
0060 #endif
0061 #endif
0062 #endif
0063 
0064     support_option_mask = 0xFFC0,
0065     support_option_emit_contnewlines = 0x0040,
0066     support_option_insert_whitespace = 0x0080,
0067     support_option_preserve_comments = 0x0100,
0068     support_option_no_character_validation = 0x0200,
0069     support_option_convert_trigraphs = 0x0400,
0070     support_option_single_line = 0x0800,
0071     support_option_prefer_pp_numbers = 0x1000,
0072     support_option_emit_line_directives = 0x2000,
0073     support_option_include_guard_detection = 0x4000,
0074     support_option_emit_pragma_directives = 0x8000
0075 };
0076 
0077 ///////////////////////////////////////////////////////////////////////////////
0078 //
0079 //  need_cpp
0080 //
0081 //      Extract, if the language to support is C++98
0082 //
0083 ///////////////////////////////////////////////////////////////////////////////
0084 inline bool
0085 need_cpp(language_support language)
0086 {
0087     return (language & ~support_option_mask) == support_cpp;
0088 }
0089 
0090 ///////////////////////////////////////////////////////////////////////////////
0091 //
0092 //  need_cpp0x
0093 //
0094 //      Extract, if the language to support is C++11
0095 //
0096 ///////////////////////////////////////////////////////////////////////////////
0097 #if BOOST_WAVE_SUPPORT_CPP0X != 0
0098 
0099 inline bool
0100 need_cpp0x(language_support language)
0101 {
0102     return (language & ~support_option_mask) == support_cpp0x;
0103 }
0104 
0105 #else
0106 
0107 inline bool
0108 need_cpp0x(language_support language)
0109 {
0110     return false;
0111 }
0112 
0113 #endif
0114 
0115 ///////////////////////////////////////////////////////////////////////////////
0116 //
0117 //  need_cpp2a
0118 //
0119 //      Extract if the language to support is C++20
0120 //
0121 ///////////////////////////////////////////////////////////////////////////////
0122 #if BOOST_WAVE_SUPPORT_CPP2A != 0
0123 
0124 inline bool
0125 need_cpp2a(language_support language)
0126 {
0127     return (language & ~support_option_mask) == support_cpp2a;
0128 }
0129 
0130 #else
0131 
0132 inline bool
0133 need_cpp2a(language_support language)
0134 {
0135     return false;
0136 }
0137 
0138 #endif
0139 
0140 #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
0141 ///////////////////////////////////////////////////////////////////////////////
0142 //
0143 //  need_c99
0144 //
0145 //      Extract, if the language to support is C99
0146 //
0147 ///////////////////////////////////////////////////////////////////////////////
0148 inline bool
0149 need_c99(language_support language)
0150 {
0151     return (language & ~support_option_mask) == support_c99;
0152 }
0153 
0154 #else  // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
0155 
0156 ///////////////////////////////////////////////////////////////////////////////
0157 inline bool
0158 need_variadics(language_support language)
0159 {
0160     return false;
0161 }
0162 
0163 ///////////////////////////////////////////////////////////////////////////////
0164 inline language_support
0165 enable_variadics(language_support language, bool enable = true)
0166 {
0167     return language;
0168 }
0169 
0170 //////////////////////////////////////////////////////////////////////////////
0171 inline bool
0172 need_c99(language_support language)
0173 {
0174     return false;
0175 }
0176 
0177 #endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
0178 
0179 ///////////////////////////////////////////////////////////////////////////////
0180 //
0181 //  get_support_options
0182 //
0183 //      Set preserve comments support in the language to support
0184 //
0185 ///////////////////////////////////////////////////////////////////////////////
0186 inline language_support
0187 get_support_options(language_support language)
0188 {
0189     return static_cast<language_support>(language & support_option_mask);
0190 }
0191 
0192 ///////////////////////////////////////////////////////////////////////////////
0193 //
0194 //  set_support_options
0195 //
0196 //      Set language option (for fine tuning of lexer behavior)
0197 //
0198 ///////////////////////////////////////////////////////////////////////////////
0199 inline language_support
0200 set_support_options(language_support language, language_support option)
0201 {
0202     return static_cast<language_support>(
0203         (language & ~support_option_mask) | (option & support_option_mask));
0204 }
0205 
0206 ///////////////////////////////////////////////////////////////////////////////
0207 //  Get and set different language options
0208 #define BOOST_WAVE_NEED_OPTION(option)                                        \
0209     inline bool need_ ## option(language_support language)                    \
0210     {                                                                         \
0211         return (language & support_option_ ## option) ? true : false;         \
0212     }                                                                         \
0213     /**/
0214 
0215 #define BOOST_WAVE_ENABLE_OPTION(option)                                      \
0216     inline language_support                                                   \
0217     enable_ ## option(language_support language, bool enable = true)          \
0218     {                                                                         \
0219         if (enable)                                                           \
0220             return static_cast<language_support>(language | support_option_ ## option); \
0221         return static_cast<language_support>(language & ~support_option_ ## option);    \
0222     }                                                                         \
0223     /**/
0224 
0225 #define BOOST_WAVE_OPTION(option)                                             \
0226     BOOST_WAVE_NEED_OPTION(option)                                            \
0227     BOOST_WAVE_ENABLE_OPTION(option)                                          \
0228     /**/
0229 
0230 ///////////////////////////////////////////////////////////////////////////////
0231 BOOST_WAVE_OPTION(long_long)                 // support_option_long_long
0232 BOOST_WAVE_OPTION(no_character_validation)   // support_option_no_character_validation
0233 BOOST_WAVE_OPTION(preserve_comments)         // support_option_preserve_comments
0234 BOOST_WAVE_OPTION(prefer_pp_numbers)         // support_option_prefer_pp_numbers
0235 BOOST_WAVE_OPTION(emit_line_directives)      // support_option_emit_line_directives
0236 BOOST_WAVE_OPTION(single_line)               // support_option_single_line
0237 BOOST_WAVE_OPTION(convert_trigraphs)         // support_option_convert_trigraphs
0238 #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
0239 BOOST_WAVE_OPTION(include_guard_detection)   // support_option_include_guard_detection
0240 #endif
0241 #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
0242 BOOST_WAVE_OPTION(variadics)                 // support_option_variadics
0243 #endif
0244 #if BOOST_WAVE_SUPPORT_VA_OPT != 0
0245 BOOST_WAVE_OPTION(va_opt)                    // support_option_va_opt
0246 #endif
0247 #if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0
0248 BOOST_WAVE_OPTION(emit_pragma_directives)    // support_option_emit_pragma_directives
0249 #endif
0250 BOOST_WAVE_OPTION(insert_whitespace)         // support_option_insert_whitespace
0251 BOOST_WAVE_OPTION(emit_contnewlines)         // support_option_emit_contnewlines
0252 #if BOOST_WAVE_SUPPORT_CPP0X != 0
0253 BOOST_WAVE_OPTION(no_newline_at_end_of_file) // support_no_newline_at_end_of_file
0254 #endif
0255 #if BOOST_WAVE_SUPPORT_HAS_INCLUDE != 0
0256 BOOST_WAVE_OPTION(has_include)               // support_option_has_include
0257 #endif
0258 
0259 #undef BOOST_WAVE_NEED_OPTION
0260 #undef BOOST_WAVE_ENABLE_OPTION
0261 #undef BOOST_WAVE_OPTION
0262 
0263 ///////////////////////////////////////////////////////////////////////////////
0264 }   // namespace wave
0265 }   // namespace boost
0266 
0267 // the suffix header occurs after all of the code
0268 #ifdef BOOST_HAS_ABI_HEADERS
0269 #include BOOST_ABI_SUFFIX
0270 #endif
0271 
0272 #endif // !defined(BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)