From 8a97ee9b3eb283e8205adca72986c086f20bb35d Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Fri, 23 Jun 2006 15:43:15 +0000 Subject: [PATCH] Fixed a missing #define BOOST_WAVE_SOURCE 1 in wave_config_constant.cpp. [SVN r34379] --- ChangeLog | 4 +++- src/token_ids.cpp | 19 +++++++++++++++---- src/wave_config_constant.cpp | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a1d8ba..40aad8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -136,7 +136,9 @@ Boost V1.34.0 - Fixed a problem, where non-evaluated #elif directives never got passed to the skippen_token() pp hook (thanks to Andreas Sæbjørnsen for reporting). - Fixed a problem in the get_tokenname() function. - +- Added a missing #define BOOST_WAVE_SOURCE 1 to the wave_config_constant.cpp + file. + Sat Feb 18 2005 - Version 1.2.3 - Added a missing throw() specification to the function diff --git a/src/token_ids.cpp b/src/token_ids.cpp index 52ed485..5558a8c 100644 --- a/src/token_ids.cpp +++ b/src/token_ids.cpp @@ -13,6 +13,7 @@ #define BOOST_WAVE_SOURCE 1 #include #include +#include #include #include @@ -204,8 +205,13 @@ static char const *tok_names[] = { /* 419 */ "MSEXT_ASM", /* 420 */ "MSEXT_REGION", /* 421 */ "MSEXT_ENDREGION", - }; - + }; + + // make sure, I have not forgotten any commas (as I did more than once) + BOOST_STATIC_ASSERT( + sizeof(tok_names)/sizeof(tok_names[0]) == T_LAST_TOKEN-T_FIRST_TOKEN + ); + unsigned int id = BASEID_FROM_TOKEN(tokid)-T_FIRST_TOKEN; return (id < T_LAST_TOKEN-T_FIRST_TOKEN) ? tok_names[id] : ""; } @@ -219,7 +225,7 @@ get_token_value(token_id tokid) // // Please note that the sequence of token names must match the sequence of // token id's defined in then enum token_id above. -static char const *tok_names[] = { +static char const *tok_values[] = { /* 256 */ "&", /* 257 */ "&&", /* 258 */ "=", @@ -390,8 +396,13 @@ static char const *tok_names[] = { /* 421 */ "#endregion", }; + // make sure, I have not forgotten any commas (as I did more than once) + BOOST_STATIC_ASSERT( + sizeof(tok_values)/sizeof(tok_values[0]) == T_LAST_TOKEN-T_FIRST_TOKEN + ); + unsigned int id = BASEID_FROM_TOKEN(tokid)-T_FIRST_TOKEN; - return (id < T_LAST_TOKEN-T_FIRST_TOKEN) ? tok_names[id] : ""; + return (id < T_LAST_TOKEN-T_FIRST_TOKEN) ? tok_values[id] : ""; } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/wave_config_constant.cpp b/src/wave_config_constant.cpp index 1bc5482..58b232f 100644 --- a/src/wave_config_constant.cpp +++ b/src/wave_config_constant.cpp @@ -9,6 +9,7 @@ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ +#define BOOST_WAVE_SOURCE 1 #include #include