Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-04-03 21:47:30


Author: hkaiser
Date: 2008-04-03 21:47:29 EDT (Thu, 03 Apr 2008)
New Revision: 44025
URL: http://svn.boost.org/trac/boost/changeset/44025

Log:
Wave: Fixed ticket #1766
Text files modified:
   trunk/boost/wave/util/cpp_macromap.hpp | 11 +++++------
   trunk/libs/wave/ChangeLog | 5 +++++
   2 files changed, 10 insertions(+), 6 deletions(-)

Modified: trunk/boost/wave/util/cpp_macromap.hpp
==============================================================================
--- trunk/boost/wave/util/cpp_macromap.hpp (original)
+++ trunk/boost/wave/util/cpp_macromap.hpp 2008-04-03 21:47:29 EDT (Thu, 03 Apr 2008)
@@ -426,7 +426,7 @@
 
 IteratorT it = begin;
 string_type name ((*it).get_value());
-typename defined_macros_type::iterator cit(current_macros -> find(name));
+typename defined_macros_type::iterator cit;
 
     if (++it != end) {
     // there should be only one token as the inspected name
@@ -434,7 +434,7 @@
             impl::get_full_name(begin, end).c_str(), main_pos);
         return false;
     }
- return cit != current_macros -> end();
+ return is_defined(name, cit, 0);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -444,10 +444,9 @@
 inline bool
 macromap<ContextT>::is_defined(StringT const &str) const
 {
-string_type name (str.c_str());
-typename defined_macros_type::iterator cit(current_macros -> find(name));
-
- return cit != current_macros -> end();
+ string_type name(str.c_str());
+ typename defined_macros_type::iterator cit;
+ return is_defined(name, cit, 0);
 }
 
 ///////////////////////////////////////////////////////////////////////////////

Modified: trunk/libs/wave/ChangeLog
==============================================================================
--- trunk/libs/wave/ChangeLog (original)
+++ trunk/libs/wave/ChangeLog 2008-04-03 21:47:29 EDT (Thu, 03 Apr 2008)
@@ -30,11 +30,16 @@
   specify any possibly derived type. This change propagates to the preprocessing
   hooks, which now get passed the most derived context type as its first
   argument allowing to access protected members in the original context type.
+ This fixes ticket #1752.
 - Fixed a problem during parsing of #pragma wave directive, where the value
   sequence contained a closing parenthesis. This caused a premature end of the
   pragma value parsing.
 - Fixed handling of support_option_single_line, which was ignored under certain
   circumstances.
+- Fixed ticket #1766: Wrong evaluation of conditional preprocessor directives
+ with predefined macros __FILE__, __LINE__ and __INCLUDE_LEVEL__. This bug
+ triggered an error in constructs like #ifndef __FILE__. Thanks to Daniel
+ Wadehn for reporting and supplying a patch.
 
 Boost V1.35.0
 - Wave Version 1.3


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