Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60820 - trunk/boost/wave
From: hartmut.kaiser_at_[hidden]
Date: 2010-03-24 20:13:27


Author: hkaiser
Date: 2010-03-24 20:13:26 EDT (Wed, 24 Mar 2010)
New Revision: 60820
URL: http://svn.boost.org/trac/boost/changeset/60820

Log:
Wave: Fixed the wave driver application to strip leading and trailing whitespace from macro names specified on the command line using -U.
Text files modified:
   trunk/boost/wave/cpp_context.hpp | 10 ++++++++--
   1 files changed, 8 insertions(+), 2 deletions(-)

Modified: trunk/boost/wave/cpp_context.hpp
==============================================================================
--- trunk/boost/wave/cpp_context.hpp (original)
+++ trunk/boost/wave/cpp_context.hpp 2010-03-24 20:13:26 EDT (Wed, 24 Mar 2010)
@@ -229,9 +229,15 @@
             has_params, is_predefined, pos, parameters, definition);
     }
     template <typename StringT>
- bool remove_macro_definition(StringT const &name,
- bool even_predefined = false)
+ bool remove_macro_definition(StringT name, bool even_predefined = false)
     {
+ // strip leading and trailing whitespace
+ typename StringT::size_type pos = name.find_first_not_of(" \t");
+ if (pos != std::string::npos) {
+ typename StringT::size_type endpos = name.find_last_not_of(" \t");
+ name = name.substr(pos, endpos-pos+1);
+ }
+
 #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
         // ensure this gets removed from the list of include guards as well
         includes.remove_pragma_once_header(


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk