From 47a0fa12397770ea49ea80f164dba8e0f82e97d1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 13 Dec 2009 10:32:44 +0200 Subject: Mark 'stdout' as a reserved name On some platforms (e.g., Windows/VC++ 8.0) stdout is a macro. --- cli/generator.cxx | 10 +++++----- cli/makefile | 3 ++- cli/options.cxx | 12 ++++++------ cli/options.hxx | 4 ++-- cli/options.ixx | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/cli/generator.cxx b/cli/generator.cxx index 7531ffe..3d7fa52 100644 --- a/cli/generator.cxx +++ b/cli/generator.cxx @@ -111,7 +111,7 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) if (!gen_cxx && !gen_man && !gen_html) gen_cxx = true; - if (ops.stdout ()) + if (ops.stdout_ ()) { if (gen_cxx) { @@ -306,7 +306,7 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) ofstream man; - if (!ops.stdout ()) + if (!ops.stdout_ ()) { path man_path (base + ops.man_suffix ()); @@ -325,7 +325,7 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) auto_rm.add (man_path); } - ostream& os (ops.stdout () ? cout : man); + ostream& os (ops.stdout_ () ? cout : man); if (prologue.is_open ()) os << prologue.rdbuf (); @@ -362,7 +362,7 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) ofstream html; - if (!ops.stdout ()) + if (!ops.stdout_ ()) { path html_path (base + ops.html_suffix ()); @@ -381,7 +381,7 @@ generate (options const& ops, semantics::cli_unit& unit, path const& p) auto_rm.add (html_path); } - ostream& os (ops.stdout () ? cout : html); + ostream& os (ops.stdout_ () ? cout : html); if (prologue.is_open ()) os << prologue.rdbuf (); diff --git a/cli/makefile b/cli/makefile index 7320630..db4281a 100644 --- a/cli/makefile +++ b/cli/makefile @@ -64,7 +64,8 @@ genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): cli := $(out_root)/cli/cli -$(gen): cli_options := --generate-file-scanner --guard-prefix CLI +$(gen): cli_options := --generate-file-scanner --guard-prefix CLI \ +--reserved-name stdout $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) diff --git a/cli/options.cxx b/cli/options.cxx index 4e8b67d..5acc325 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -505,7 +505,7 @@ options (int& argc, html_prologue_ (), html_epilogue_ (), class__ (), - stdout_ (), + stdout__ (), hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), @@ -547,7 +547,7 @@ options (int start, html_prologue_ (), html_epilogue_ (), class__ (), - stdout_ (), + stdout__ (), hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), @@ -589,7 +589,7 @@ options (int& argc, html_prologue_ (), html_epilogue_ (), class__ (), - stdout_ (), + stdout__ (), hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), @@ -633,7 +633,7 @@ options (int start, html_prologue_ (), html_epilogue_ (), class__ (), - stdout_ (), + stdout__ (), hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), @@ -673,7 +673,7 @@ options (::cli::scanner& s, html_prologue_ (), html_epilogue_ (), class__ (), - stdout_ (), + stdout__ (), hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), @@ -824,7 +824,7 @@ struct _cli_options_map_init _cli_options_map_["--class"] = &::cli::thunk< options, std::string, &options::class__ >; _cli_options_map_["--stdout"] = - &::cli::thunk< options, bool, &options::stdout_ >; + &::cli::thunk< options, bool, &options::stdout__ >; _cli_options_map_["--hxx-suffix"] = &::cli::thunk< options, std::string, &options::hxx_suffix_ >; _cli_options_map_["--ixx-suffix"] = diff --git a/cli/options.hxx b/cli/options.hxx index 1c7456c..24af0f2 100644 --- a/cli/options.hxx +++ b/cli/options.hxx @@ -351,7 +351,7 @@ class options class_ () const; const bool& - stdout () const; + stdout_ () const; const std::string& hxx_suffix () const; @@ -418,7 +418,7 @@ class options std::string html_prologue_; std::string html_epilogue_; std::string class__; - bool stdout_; + bool stdout__; std::string hxx_suffix_; std::string ixx_suffix_; std::string cxx_suffix_; diff --git a/cli/options.ixx b/cli/options.ixx index cfaf2ac..b814835 100644 --- a/cli/options.ixx +++ b/cli/options.ixx @@ -250,9 +250,9 @@ class_ () const } inline const bool& options:: -stdout () const +stdout_ () const { - return this->stdout_; + return this->stdout__; } inline const std::string& options:: -- cgit v1.1