diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-07 07:00:20 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-07 07:00:20 +0000 |
commit | 6feedbb121fb24f0ddd3fc78c60ff97d65449e4d (patch) | |
tree | ca44e139ccdeb1f9656d375de023cfde447ec9d5 | |
parent | 133a564033533fcc103dbce1b7698428dafbf711 (diff) | |
download | ATCD-6feedbb121fb24f0ddd3fc78c60ff97d65449e4d.tar.gz |
ChangeLogTag: Sun Dec 7 000:46:52 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_traits.cpp | 36 |
2 files changed, 50 insertions, 2 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2a3a344f6f4..face98150af 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,16 @@ +Sun Dec 7 000:46:52 2003 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_visitor_traits.cpp: + + Added #ifdef guard to declaration of Array_Traits<> specializations, + similar to the ones already generated for Array_Traits<> + specialization implementations in the *C.i file. These guards are + composed from the flat name of the unaliased array element type + and the dimension(s), eliminating redefinition errors that can + occur when two arrays of the same element type and length (either + both typedef'd or both anonymous) appear in the same translation + unit. + Sun Dec 7 00:53:38 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * orbsvcs/orbsvcs/Makefile.RTEvent: @@ -17,8 +30,7 @@ Sun Dec 7 00:41:52 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * tao/Messaging/Asynch_Reply_Dispatcher.cpp: * tao/Messaging/Asynch_Reply_Dispatcher.h: - Fixed a bunch of copile errors when compiled with exceptions=0. - + Fixed a bunch of compile errors when compiled with exceptions=0. Sat Dec 6 23:42:13 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp index a27ab57ca23..90c423b1eb4 100644 --- a/TAO/TAO_IDL/be/be_visitor_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp @@ -35,6 +35,7 @@ #include "be_extern.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_visitor_traits, @@ -387,6 +388,39 @@ be_visitor_traits::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); + // Generate the array traits specialization definitions, + // guarded by #ifdef on unaliased array element type and length. + + ACE_CString unique; + be_type *bt = be_type::narrow_from_decl (node->base_type ()); + AST_Decl::NodeType nt = bt->node_type (); + + if (nt == AST_Decl::NT_typedef) + { + be_typedef *td = be_typedef::narrow_from_decl (bt); + unique = td->primitive_base_type ()->flat_name (); + } + else + { + unique = bt->flat_name (); + } + + char buf[NAMEBUFSIZE]; + + for (unsigned long i = 0; i < node->n_dims (); ++i) + { + ACE_OS::memset (buf, + '\0', + NAMEBUFSIZE); + ACE_OS::sprintf (buf, + "_%ld", + node->dims ()[i]->ev ()->u.ulval); + unique += buf; + } + + unique += "_traits"; + os->gen_ifdef_macro (unique.fast_rep ()); + *os << be_nl << be_nl << "ACE_TEMPLATE_SPECIALIZATION" << be_nl << "struct " << be_global->stub_export_macro () << " Array_Traits<" @@ -410,6 +444,8 @@ be_visitor_traits::visit_array (be_array *node) << be_uidt_nl << "};"; + os->gen_endif (); + node->cli_traits_gen (I_TRUE); return 0; } |