diff --git a/ChangeLog b/ChangeLog index 372867b..c61cee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,11 @@ CHANGELOG - Fixed a compilation error of the testwave executable (added a missing namespace specifier). - Added a missing header to make cpp.re.cpp compile on CW. +- __BASE_FILE__ predefined macro now returns a properly escaped file name + string. +- Fixed the function boost::wave::util::impl::unescape_lit(). +- Added the '$F' replacement string to the testwave application. This allows + to handle file paths sensitive comparison of the expected and real results. Tue Mar 22 14:52:45 WEST 2005 Version 1.1.15 diff --git a/include/boost/wave/util/cpp_macromap.hpp b/include/boost/wave/util/cpp_macromap.hpp index 71d5ea8..e0045a9 100644 --- a/include/boost/wave/util/cpp_macromap.hpp +++ b/include/boost/wave/util/cpp_macromap.hpp @@ -1618,13 +1618,21 @@ position_type pos; // predefine the __BASE_FILE__ macro which contains the main file name if (string_type(fname) != "") { + fs::path filename(fname, fs::native); + + using boost::wave::util::impl::escape_lit; predefine_macro(current_scope, "__BASE_FILE__", - token_type(T_STRINGLIT, string_type("\"") + fname + "\"", pos)); + token_type(T_STRINGLIT, string_type("\"") + + escape_lit(filename.native_file_string()).c_str() + "\"", pos)); base_name = fname; } else if (!base_name.empty()) { + fs::path filename(base_name.c_str(), fs::native); + + using boost::wave::util::impl::escape_lit; predefine_macro(current_scope, "__BASE_FILE__", - token_type(T_STRINGLIT, string_type("\"") + base_name + "\"", pos)); + token_type(T_STRINGLIT, string_type("\"") + + escape_lit(filename.native_file_string()).c_str() + "\"", pos)); } // now add the dynamic macros diff --git a/include/boost/wave/util/macro_helpers.hpp b/include/boost/wave/util/macro_helpers.hpp index 969d3f2..d8d7097 100644 --- a/include/boost/wave/util/macro_helpers.hpp +++ b/include/boost/wave/util/macro_helpers.hpp @@ -58,11 +58,16 @@ namespace impl { if ('\\' == value[pos1+1] || '\"' == value[pos1+1] || '?' == value[pos1+1]) { - result += value.substr(pos, pos1-pos); + result = result + value.substr(pos, pos1-pos); + pos1 = value.find_first_of ("\\", (pos = pos1+1)+1); } - pos1 = value.find_first_of ("\\", (pos = pos1)+1); + else { + result = result + value.substr(pos, pos1-pos+1); + pos1 = value.find_first_of ("\\", pos = pos1+1); + } + } while (pos1 != StringT::npos); - result += value.substr(pos); + result = result + value.substr(pos); } else { // the string doesn't contain any escaped character sequences diff --git a/test/build/Jamfile b/test/build/Jamfile index 81636ec..b693823 100644 --- a/test/build/Jamfile +++ b/test/build/Jamfile @@ -25,34 +25,12 @@ SOURCES = testwave testwave_app # # This are the arguments for the testwave executable # -TESTWAVE_ARGUMENTS = -d2 -S../testwave/testfiles/ ; +TESTWAVE_ARGUMENTS = -d2 -S../testwave/testfiles ; # # These are the names of the different unit tests to run # -TESTWAVE_FILES_001 = - 001_001.cpp 001_002.cpp 001_003.cpp 001_004.cpp 001_005.cpp - 001_006.cpp 001_007.cpp 001_008.cpp 001_009.cpp 001_010.cpp - 001_011.cpp 001_012.cpp 001_013.cpp 001_014.cpp 001_015.cpp - 001_016.cpp 001_017.cpp 001_018.cpp 001_019.cpp 001_020.cpp - 001_021.cpp 001_022.cpp 001_023.cpp 001_024.cpp 001_025.cpp - 001_026.cpp 001_027.cpp 001_028.cpp 001_029.cpp 001_030.cpp - 001_031.cpp 001_032.cpp 001_033.cpp - ; - -TESTWAVE_FILES_002 = - 002_001.cpp 002_002.cpp 002_003.cpp 002_004.cpp 002_005.cpp - 002_006.cpp 002_007.cpp 002_008.cpp 002_009.cpp 002_010.cpp - 002_011.cpp 002_012.cpp 002_013.cpp - ; - -TESTWAVE_FILES_003 = - 003_001.cpp 003_002.cpp 003_003.cpp 003_004.cpp - ; - -TESTWAVE_FILES_999 = - 999_001.cpp 999_002.cpp 999_003.cpp 999_004.cpp 999_005.cpp - 999_006.cpp 999_007.cpp 999_008.cpp 999_009.cpp +TESTWAVE_FILES = test.cfg ; # @@ -80,37 +58,11 @@ test-suite wave : [ run -