diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-07-12 13:19:54 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-07-12 13:19:54 +0000 |
commit | 91ab3ee3b678ec717e0373be20201a53906ef118 (patch) | |
tree | de25b7c3f0a042c041112b2200ca3b1a1715eda0 | |
parent | 0036eb701dd5328b16b231583ff9e0cc52243fae (diff) | |
download | ATCD-91ab3ee3b678ec717e0373be20201a53906ef118.tar.gz |
ChangeLogTag: Tue Jul 12 13:15:24 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_codegen.cpp | 19 |
2 files changed, 28 insertions, 2 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 5e8c3e8a018..8fc49bffda4 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Tue Jul 12 13:15:24 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_codegen.cpp: + + Added code generation of a preprocessor version check that + will output an error message if the generated file's version + doesn't match the IDL compiler's (TAO's) version. This fix + closes [BUGID:3979]. + Mon Jul 11 14:55:57 UTC 2011 Adam Mitz <mitza@ociweb.com> * TAO_IDL/be/be_util.cpp: @@ -14,7 +23,7 @@ Fri Jul 8 14:57:31 UTC 2011 Jeff Parsons <j.parsons@vanderbilt.edu> where the old location gave rise to infinite recursion and a stack overflow. Thanks to Johnny Willemsen <jwillemsen@remedy.nl> for uncovering the bug and submitting - example IDL. + example IDL. This fix closes [BUGID:3978]. * tests/IDL_Test/interface.cpp: diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index 1627efa80a4..102dd29eee0 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -22,6 +22,10 @@ #include "utl_string.h" #include "idl_defines.h" +// This one TAO include is needed to generate the +// version check code. +#include "../../tao/Version.h" + #include "ace/OS_NS_ctype.h" #include "ace/OS_NS_sys_time.h" #include "ace/OS_NS_unistd.h" @@ -321,7 +325,15 @@ TAO_CodeGen::start_client_header (const char *fname) } } - // Generate the TAO_EXPORT_MACRO macro. + // Generate the regeneration check. + *this->client_header_ << "\n\n#if TAO_MAJOR_VERSION != " << TAO_MAJOR_VERSION + << " || TAO_MINOR_VERSION != " << TAO_MINOR_VERSION + << " || TAO_BETA_VERSION != " << TAO_BETA_VERSION + << "\n#error This file should be regenerated with TAO_IDL from version " + << TAO_VERSION + << "\n#endif"; + + // Generate the TAO_EXPORT_MACRO macro. *this->client_header_ << "\n\n#if defined (TAO_EXPORT_MACRO)\n"; *this->client_header_ << "#undef TAO_EXPORT_MACRO\n"; *this->client_header_ << "#endif\n"; @@ -2487,6 +2499,11 @@ TAO_CodeGen::gen_stub_hdr_includes (void) // _vars and _outs are typedefs of template class instantiations. this->gen_var_file_includes (); + // Version file, for code that checks needs for regeneration. + this->gen_standard_include (this->client_header_, + "tao/Version.h", + true); + // Versioned namespace support. this->gen_standard_include (this->client_header_, "tao/Versioned_Namespace.h", |