summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-08-04 20:56:27 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-08-04 20:56:27 +0000
commit0395c72a89adbcfde028a5b952d919b297983ff3 (patch)
treed0209d8a5a5769192a3b9b9de07e7e80fd57782e /TAO
parent15e6dc6684cea3410274153391ffcba38fd8fa3f (diff)
downloadATCD-0395c72a89adbcfde028a5b952d919b297983ff3.tar.gz
ChangeLogTag: Wed Aug 4 20:52:39 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog16
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp9
-rw-r--r--TAO/TAO_IDL/be/be_global.cpp20
-rw-r--r--TAO/TAO_IDL/be/be_util.cpp5
-rw-r--r--TAO/TAO_IDL/be_include/be_global.h10
-rw-r--r--TAO/docs/compiler.html13
6 files changed, 69 insertions, 4 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 899a7ed4e11..5b84202cf30 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,19 @@
+Wed Aug 4 20:52:39 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_codegen.cpp:
+ * TAO_IDL/be/be_util.cpp:
+ * TAO_IDL/be/be_global.cpp:
+ * TAO_IDL/be_include/be_global.h:
+
+ New IDL compiler option -Sg, which disables the generation of
+ unique extensions on header file preprocessor guards. These
+ changes are from a patch supplied by Bogdan Jeram
+ <bjeram at eso dot org>, and close [BUGID:3867].
+
+ * docs/compiler.html:
+
+ Updated IDL compiler options table.
+
Wed Aug 4 19:24:15 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* MPC/config/rtcosscheduling.mpb:
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 3a7e6e1a94a..bd40860d358 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -2464,10 +2464,13 @@ TAO_CodeGen::gen_ifndef_string (const char *fname,
}
}
- ACE_OS::strcat (macro_name, "_XXXXXX");
- char * const t = ACE_OS::strstr (macro_name, "XXXXXX");
+ if (be_global->gen_unique_guards ())
+ {
+ ACE_OS::strcat (macro_name, "_XXXXXX");
+ char * const t = ACE_OS::strstr (macro_name, "XXXXXX");
- this->make_rand_extension (t);
+ this->make_rand_extension (t);
+ }
ACE_OS::strcat (macro_name, suffix);
diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp
index 74fdb591172..8a1afa511ae 100644
--- a/TAO/TAO_IDL/be/be_global.cpp
+++ b/TAO/TAO_IDL/be/be_global.cpp
@@ -129,6 +129,7 @@ BE_GlobalData::BE_GlobalData (void)
gen_template_export_ (false),
gen_ostream_operators_ (false),
gen_custom_ending_ (true),
+ gen_unique_guards_ (true),
gen_ciao_svnt_ (false),
gen_ciao_exec_idl_ (false),
gen_ciao_exec_impl_ (false),
@@ -2265,6 +2266,18 @@ BE_GlobalData::gen_custom_ending (bool val)
}
bool
+BE_GlobalData::gen_unique_guards (void) const
+{
+ return this->gen_unique_guards_;
+}
+
+void
+BE_GlobalData::gen_unique_guards (bool val)
+{
+ this->gen_unique_guards_ = val;
+}
+
+bool
BE_GlobalData::gen_ciao_svnt (void) const
{
return this->gen_ciao_svnt_;
@@ -3274,10 +3287,15 @@ BE_GlobalData::parse_args (long &i, char **av)
}
else if (av[i][2] == 'e')
{
- // disable custom file endings for included idl/pidl
+ // Disable custom file endings for included idl/pidl
// files from TAO specific include paths.
be_global->gen_custom_ending (false);
}
+ else if (av[i][2] == 'g')
+ {
+ // Disable generation of unique guards.
+ be_global->gen_unique_guards (false);
+ }
else
{
ACE_ERROR ((
diff --git a/TAO/TAO_IDL/be/be_util.cpp b/TAO/TAO_IDL/be/be_util.cpp
index 57ba947fde1..8a2adb6245c 100644
--- a/TAO/TAO_IDL/be/be_util.cpp
+++ b/TAO/TAO_IDL/be/be_util.cpp
@@ -814,6 +814,11 @@ be_util::usage (void)
));
ACE_DEBUG ((
LM_DEBUG,
+ ACE_TEXT (" -Sg\t\t\tsuppress generating of unique header guards")
+ ACE_TEXT (" (unique guards are generated by default)\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
ACE_TEXT (" -TS <value>\t\tset tab size for generated files")
ACE_TEXT (" (default is 2 spaces)\n")
));
diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h
index c9736c2955d..ec6ac40ff4b 100644
--- a/TAO/TAO_IDL/be_include/be_global.h
+++ b/TAO/TAO_IDL/be_include/be_global.h
@@ -786,6 +786,10 @@ public:
bool gen_custom_ending (void) const;
void gen_custom_ending (bool val);
+ /// Accessors for the member gen_unique_guards_.
+ bool gen_unique_guards (void) const;
+ void gen_unique_guards (bool val);
+
/// Accessors for the corresponding members.
bool gen_ciao_svnt (void) const;
@@ -1129,6 +1133,12 @@ private:
*/
bool gen_custom_ending_;
+ /**
+ * True by default, but a command line option can turn this off so
+ * the generated code (header) files will not be proteced by unique guards.
+ */
+ bool gen_unique_guards_;
+
/// False by default, these flags trigger code generation
/// formerly done by the CIAO CIDL compiler.
bool gen_ciao_svnt_;
diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html
index c4927e4015a..5e64664e075 100644
--- a/TAO/docs/compiler.html
+++ b/TAO/docs/compiler.html
@@ -1171,6 +1171,19 @@ also receives other options that are specific to it.<p>
use TAO specific files with their original endings;</td>
</tr>
+ <tr><a name="Sg">
+ <td><tt>-Sg</tt></td>
+
+ <td>Disable generation of unique preprocessor guards for generated
+ header files. The guards will still be generated, but without
+ the unique random extension.</td>
+ <td>This option is useful when a system has several versions of a
+ generated header file, and only the newest version is to be
+ included by the preprocessor. The default behavior will
+ generate a unique extension for each version, subverting
+ the desired function of the preprocessor in such a system.</td>
+ </tr>
+
<tr><a name="Sfr">
<td><tt>-Sfr</tt></td>