diff options
-rw-r--r-- | TAO/TAO_IDL/be/be_union.cpp | 25 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp | 13 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp | 12 |
3 files changed, 37 insertions, 13 deletions
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index de051fbc7f4..64efce93c25 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -364,7 +364,7 @@ be_union::gen_var_impl (char *, char *) ci->decr_indent (); *ci << "}\n\n"; - // in, inout, out, and _retn + // in, inout, out, _retn, and ptr ci->indent (); *ci << "ACE_INLINE const " << name () << " &" << nl; *ci << fname << "::in (void) const" << nl; @@ -383,7 +383,7 @@ be_union::gen_var_impl (char *, char *) ci->decr_indent (); *ci << "}\n\n"; - // the out is handled differently based on our size type + // the out and _retn are handled differently based on our size type ci->indent (); if (this->size_type () == be_decl::VARIABLE) { @@ -429,19 +429,18 @@ be_union::gen_var_impl (char *, char *) *ci << "return *this->ptr_;\n"; ci->decr_indent (); *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - } + // the additional ptr () member function + ci->indent (); + *ci << "ACE_INLINE " << name () << " *" << nl; + *ci << fname << "::ptr (void) const" << nl; + *ci << "{\n"; + ci->incr_indent (); + *ci << "return this->ptr_;\n"; + ci->decr_indent (); + *ci << "}\n\n"; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp index 32cf0b13ed9..08ae4e574d0 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -364,6 +364,19 @@ be_visitor_field_ch::visit_sequence (be_sequence *node) ), -1); } delete visitor; + + // Generate the anonymous sequence member typedef + // but we must protect against certain versions of g++. + // This provides a consistent name to use instead of the + // implementation-specific name. + be_decl *bs = this->ctx_->scope (); // get the enclosing struct backend + os->decr_indent (0); + *os << "#if !defined (__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)" + << be_idt_nl + << "typedef " << bt->nested_type_name (bs) + << " _" << this->ctx_->node ()->local_name () << "_seq;" << be_uidt_nl; + *os << "#endif /* ! __GNUC__ || ACE_HAS_GNUG_PRE_2_8 */\n" << be_nl; + os->incr_indent (); } os->indent (); // start from current indentation level diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp index 3e622df7a56..edcba0c2bef 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp @@ -491,6 +491,18 @@ be_visitor_union_branch_public_ch::visit_sequence (be_sequence *node) ), -1); } delete visitor; + + // Generate the anonymous sequence member typedef + // but we must protect against certain versions of g++. + // This provides a consistent name to use instead of the + // implementation-specific name. + os->decr_indent (0); + *os << "#if !defined (__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)" + << be_idt_nl + << "typedef " << bt->nested_type_name (bu) + << " _" << ub->local_name () << "_seq;" << be_uidt_nl; + *os << "#endif /* ! __GNUC__ || ACE_HAS_GNUG_PRE_2_8 */\n" << be_nl; + os->incr_indent (); } os->indent (); // set method |