Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71833 - in trunk: boost/wave libs/wave tools/wave
From: hartmut.kaiser_at_[hidden]
Date: 2011-05-08 14:34:59


Author: hkaiser
Date: 2011-05-08 14:34:58 EDT (Sun, 08 May 2011)
New Revision: 71833
URL: http://svn.boost.org/trac/boost/changeset/71833

Log:
Wave: bumped version number (V2.3), fixed a problem in interactive mode of Wave driver
Text files modified:
   trunk/boost/wave/wave_version.hpp | 4 +-
   trunk/libs/wave/ChangeLog | 2 +
   trunk/tools/wave/cpp.cpp | 72 ++++++++++++++++++++--------------------
   3 files changed, 40 insertions(+), 38 deletions(-)

Modified: trunk/boost/wave/wave_version.hpp
==============================================================================
--- trunk/boost/wave/wave_version.hpp (original)
+++ trunk/boost/wave/wave_version.hpp 2011-05-08 14:34:58 EDT (Sun, 08 May 2011)
@@ -16,11 +16,11 @@
 // BOOST_WAVE_VERSION & 0x0000FF is the sub-minor version
 // BOOST_WAVE_VERSION & 0x00FF00 is the minor version
 // BOOST_WAVE_VERSION & 0xFF0000 is the major version
-#define BOOST_WAVE_VERSION 0x020200
+#define BOOST_WAVE_VERSION 0x020300
 
 // The following defines contain the same information as above
 #define BOOST_WAVE_VERSION_MAJOR 2
-#define BOOST_WAVE_VERSION_MINOR 2
+#define BOOST_WAVE_VERSION_MINOR 3
 #define BOOST_WAVE_VERSION_SUBMINOR 0
 
 #endif // !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)

Modified: trunk/libs/wave/ChangeLog
==============================================================================
--- trunk/libs/wave/ChangeLog (original)
+++ trunk/libs/wave/ChangeLog 2011-05-08 14:34:58 EDT (Sun, 08 May 2011)
@@ -35,6 +35,8 @@
   but also removes this macro from consideration for Wave itself. This can
   cause unexpected results if the suppressed macro would influence #ifdef's
   later on.
+- Fixed Wave driver to retain all macros defined on the command line in
+ interactive mode.
 
 Boost V1.46.0
 - V2.2.0

Modified: trunk/tools/wave/cpp.cpp
==============================================================================
--- trunk/tools/wave/cpp.cpp (original)
+++ trunk/tools/wave/cpp.cpp 2011-05-08 14:34:58 EDT (Sun, 08 May 2011)
@@ -143,10 +143,10 @@
         "LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)",
         0
     };
-
+
     for (int i = 0; 0 != copyright[i]; ++i)
         cout << copyright[i] << endl;
-
+
     return 0; // exit app
 }
 
@@ -216,7 +216,7 @@
             else {
             // store this path as an user path
                 p->paths.push_back(t);
- }
+ }
         }
     };
 
@@ -236,7 +236,7 @@
             }
             return false;
         }
-
+
     vector<std::string> options;
     std::string line;
 
@@ -245,7 +245,7 @@
             std::string::size_type pos = line.find_first_not_of(" \t");
             if (pos == std::string::npos)
                 continue;
-
+
         // skip comment lines
             if ('#' != line[pos]) {
             // strip leading and trailing whitespace
@@ -281,7 +281,7 @@
         }
         return file;
     }
-
+
 ///////////////////////////////////////////////////////////////////////////////
 }
 
@@ -311,7 +311,7 @@
         : print_time(false), outstrm(outstrm_)
         {
         }
-
+
         ~auto_stop_watch()
         {
             if (print_time) {
@@ -320,7 +320,7 @@
                       << std::endl;
             }
         }
-
+
         void set_print_time(bool print_time_)
         {
             print_time = print_time_;
@@ -350,7 +350,7 @@
                       "end-of-file while writing to the stream\n";
         }
         return result;
- }
+ }
 
     ///////////////////////////////////////////////////////////////////////////
     // Retrieve the position of a macro definition
@@ -364,7 +364,7 @@
         bool is_predefined = false;
         std::vector<typename Context::token_type> parameters;
         typename Context::token_sequence_type definition;
-
+
         return ctx.get_macro_definition(name, has_parameters, is_predefined,
             pos, parameters, definition);
     }
@@ -422,7 +422,7 @@
 
         return result;
     }
-
+
     ///////////////////////////////////////////////////////////////////////////
     // Read one logical line of text
     inline bool
@@ -560,13 +560,13 @@
         for (name_iterator it = ctx.macro_names_begin(); it != end; ++it)
         {
             typedef std::vector<context_type::token_type> parameters_type;
-
+
         bool has_pars = false;
         bool predef = false;
         context_type::position_type pos;
         parameters_type pars;
         context_type::token_sequence_type def;
-
+
             if (ctx.get_macro_definition(*it, has_pars, predef, pos, pars, def))
             {
                 macronames_out << (predef ? "-P" : "-D") << *it;
@@ -666,7 +666,7 @@
                                    std::istreambuf_iterator<char>());
 #endif
         }
-
+
     // The preprocessing of the input stream is done on the fly behind the
     // scenes during iteration over the context_type::iterator_type stream.
     std::ofstream output;
@@ -871,13 +871,13 @@
                     ctx.get_language(), false));
         }
 #endif
-
+
     // enable preserving comments mode
         if (preserve_comments) {
             ctx.set_language(
                 boost::wave::enable_preserve_comments(ctx.get_language()));
         }
-
+
     // control the generation of #line directives
         if (vm.count("line")) {
             int lineopt = vm["line"].as<int>();
@@ -910,7 +910,7 @@
     // add include directories to the system include search paths
         if (vm.count("sysinclude")) {
           vector<std::string> syspaths = vm["sysinclude"].as<vector<std::string> >();
-
+
             vector<std::string>::const_iterator end = syspaths.end();
             for (vector<std::string>::const_iterator cit = syspaths.begin();
                  cit != end; ++cit)
@@ -918,7 +918,7 @@
                 ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*cit).c_str());
             }
         }
-
+
     // add include directories to the include search paths
         if (vm.count("include")) {
             cmd_line_utils::include_paths const &ip =
@@ -943,7 +943,7 @@
                 ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*syscit).c_str());
             }
         }
-
+
     // add additional defined macros
         if (vm.count("define")) {
           vector<std::string> const &macros = vm["define"].as<vector<std::string> >();
@@ -1003,7 +1003,7 @@
             }
             ctx.set_max_include_nesting_depth(max_depth);
         }
-
+
     // open the output file
         if (vm.count("output")) {
         // try to open the file, where to put the preprocessed output
@@ -1049,17 +1049,17 @@
     // we assume the session to be interactive if input is stdin and output is
     // stdout and the output is not inhibited
     bool is_interactive = input_is_stdin && !output.is_open() && allow_output;
-
+
         if (is_interactive) {
         // if interactive we don't warn for missing endif's etc.
             ctx.set_language(
- boost::wave::enable_single_line(ctx.get_language()));
+ boost::wave::enable_single_line(ctx.get_language()), false);
         }
-
+
     // analyze the input file
     context_type::iterator_type first = ctx.begin();
     context_type::iterator_type last = ctx.end();
-
+
     // preprocess the required include files
         if (vm.count("forceinclude")) {
         // add the filenames to force as include files in _reverse_ order
@@ -1093,7 +1093,7 @@
         do {
         // loop over all generated tokens outputting the generated text
         bool finished = false;
-
+
             if (input_is_stdin) {
                 if (is_interactive)
                     cout << ">>> "; // prompt if is interactive
@@ -1104,16 +1104,16 @@
                     break; // end of input reached
                 first = ctx.begin(instring.begin(), instring.end());
             }
-
+
         bool need_to_advanve = false;
-
+
             do {
                 try {
                     if (need_to_advanve) {
                         ++first;
                         need_to_advanve = false;
                     }
-
+
                     while (first != last) {
                     // store the last known good token position
                         current_position = (*first).get_position();
@@ -1131,7 +1131,7 @@
                             else
                                 cout << (*first).get_value();
                         }
-
+
                     // advance to the next token
                         ++first;
                     }
@@ -1215,12 +1215,12 @@
              << " using a different configuration (see wave_config.hpp)."
              << endl;
     }
-
+
     // analyze the command line options and arguments
     try {
     // declare the options allowed on the command line only
     po::options_description desc_cmdline ("Options allowed on the command line only");
-
+
         desc_cmdline.add_options()
             ("help,h", "print out program usage (this message)")
             ("version,v", "print the version number")
@@ -1257,7 +1257,7 @@
             ("nesting,n", po::value<int>(),
                 "specify a new maximal include nesting depth")
         ;
-
+
     po::options_description desc_ext ("Extended options (allowed everywhere)");
 
         desc_ext.add_options()
@@ -1309,21 +1309,21 @@
                 "or 'wave.state' [-] (interactive mode only)")
 #endif
         ;
-
+
     // combine the options for the different usage schemes
     po::options_description desc_overall_cmdline;
     po::options_description desc_overall_cfgfile;
 
         desc_overall_cmdline.add(desc_cmdline).add(desc_generic).add(desc_ext);
         desc_overall_cfgfile.add(desc_generic).add(desc_ext);
-
+
     // parse command line and store results
         using namespace boost::program_options::command_line_style;
 
     po::parsed_options opts(po::parse_command_line(argc, argv,
             desc_overall_cmdline, unix_style, cmd_line_utils::at_option_parser));
     po::variables_map vm;
-
+
         po::store(opts, vm);
         po::notify(vm);
 
@@ -1389,7 +1389,7 @@
             cout << desc_help << endl;
             return 1;
         }
-
+
         if (vm.count("version")) {
             cout << get_version() << endl;
             return 0;


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