summaryrefslogtreecommitdiff
path: root/cli/runtime-header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-19 14:53:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-19 14:53:52 +0200
commit813e4744038ec3a1ca8095111074c1cb2a824d83 (patch)
treec4cda65a3280c09c50c0a3e227cdff5b43240247 /cli/runtime-header.cxx
parent3e34f8ac2ba3b719f13a8f9ef7422cbee8b02192 (diff)
Implement entire page usage generation
Diffstat (limited to 'cli/runtime-header.cxx')
-rw-r--r--cli/runtime-header.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx
index 21d3723..42f7063 100644
--- a/cli/runtime-header.cxx
+++ b/cli/runtime-header.cxx
@@ -25,7 +25,20 @@ generate_runtime_header (context& ctx)
<< "#include <exception>" << endl
<< endl;
- ctx.cli_open ();
+ // VC++ and xlC don't like the (void)x expression if x is a reference
+ // to an incomplete type. On the other hand, GCC warns that (void*)&x
+ // doesn't have any effect.
+ //
+ os << "#ifndef CLI_POTENTIALLY_UNUSED" << endl
+ << "# if defined(_MSC_VER) || defined(__xlC__)" << endl
+ << "# define CLI_POTENTIALLY_UNUSED(x) (void*)&x" << endl
+ << "# else" << endl
+ << "# define CLI_POTENTIALLY_UNUSED(x) (void)x" << endl
+ << "# endif" << endl
+ << "#endif" << endl
+ << endl;
+
+ ctx.ns_open (ctx.cli);
// unknown_mode
//
@@ -396,5 +409,5 @@ generate_runtime_header (context& ctx)
<< "struct parser;"
<< endl;
- ctx.cli_close ();
+ ctx.ns_close (ctx.cli);
}