Update of /cvsroot/boost/boost/boost/wave/util
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27052/boost/wave/util

Modified Files:
        cpp_iterator.hpp cpp_macromap.hpp 
Log Message:
Wave: Changed return type of some preprocessing hooks to allow to skip the 
corresponding preprocessor action.

Index: cpp_iterator.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/util/cpp_iterator.hpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- cpp_iterator.hpp    26 Jun 2007 19:40:03 -0000      1.63
+++ cpp_iterator.hpp    4 Jul 2007 21:56:55 -0000       1.64
@@ -1119,7 +1119,8 @@
 #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
     ctx.get_hooks().found_directive(found_directive);     
 #else
-    ctx.get_hooks().found_directive(ctx, found_directive);     
+    if (ctx.get_hooks().found_directive(ctx, found_directive))
+        return true;    // skip this directive and return newline only
 #endif
     
     switch (static_cast<unsigned int>(id)) {
@@ -1278,7 +1279,7 @@
 #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
     ctx.get_hooks().found_include_directive(f, include_next);
 #else
-    if (!ctx.get_hooks().found_include_directive(ctx, f, include_next))
+    if (ctx.get_hooks().found_include_directive(ctx, f, include_next))
         return true;    // client returned false: skip file to include 
 #endif
 

Index: cpp_macromap.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/wave/util/cpp_macromap.hpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cpp_macromap.hpp    27 Jun 2007 01:23:20 -0000      1.37
+++ cpp_macromap.hpp    4 Jul 2007 21:56:55 -0000       1.38
@@ -1236,10 +1236,16 @@
                 macro_def.macroname, macro_def.macroparameters, 
                 macro_def.macrodefinition, curr_token, arguments);
 #else
-            ctx.get_hooks().expanding_function_like_macro(
+            if (ctx.get_hooks().expanding_function_like_macro(
                 ctx, macro_def.macroname, macro_def.macroparameters, 
                 macro_def.macrodefinition, curr_token, arguments,
-                seqstart, first);
+                    seqstart, first))
+            {
+                // do not expand this macro, just copy the whole sequence 
+                std::copy(seqstart, first, 
+                    std::inserter(replacement_list, replacement_list.end()));
+                return false;           // no further preprocessing required
+            }
 #endif
 
         // expand the replacement list of this macro
@@ -1252,8 +1258,15 @@
             ctx.get_hooks().expanding_object_like_macro(
                 macro_def.macroname, macro_def.macrodefinition, curr_token);
 #else
-            ctx.get_hooks().expanding_object_like_macro(
-                ctx, macro_def.macroname, macro_def.macrodefinition, 
curr_token);
+            if (ctx.get_hooks().expanding_object_like_macro(
+                    ctx, macro_def.macroname, macro_def.macrodefinition, 
+                    curr_token))
+            {
+                // do not expand this macro, just copy the whole sequence 
+                replacement_list.push_back(curr_token);
+                ++first;                // skip macro name
+                return false;           // no further preprocessing required
+            }
 #endif
 
         bool found = false;
@@ -1289,8 +1302,15 @@
             ctx.get_hooks().expanding_object_like_macro(
                 macro_def.macroname, macro_def.macrodefinition, curr_token);
 #else
-            ctx.get_hooks().expanding_object_like_macro(
-                ctx, macro_def.macroname, macro_def.macrodefinition, 
curr_token);
+            if (ctx.get_hooks().expanding_object_like_macro(
+                    ctx, macro_def.macroname, macro_def.macrodefinition, 
+                    curr_token))
+            {
+                // do not expand this macro, just copy the whole sequence 
+                replacement_list.push_back(curr_token);
+                ++first;                // skip macro name
+                return false;           // no further preprocessing required
+            }
 #endif
 
         bool found = false;


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to