diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-04-26 21:57:47 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-04-26 21:58:44 -0500 |
commit | c733aaf4ca00fa2f380452eba76815805711e239 (patch) | |
tree | d5a3859773184529f6c751636bbcdd50b5fe372f | |
parent | ac8caeed1f3db9239e84ccc79f5cf3a1f952a6d7 (diff) | |
download | ATCD-c733aaf4ca00fa2f380452eba76815805711e239.tar.gz |
Support C++ Keywords in DCPS_DATA_SEQUENCE_TYPE
Made for https://github.com/objectcomputing/OpenDDS/pull/2608
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp | 21 | ||||
-rw-r--r-- | TAO/TAO_IDL/driver/drv_preproc.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/orbconf.h | 2 |
3 files changed, 7 insertions, 18 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp index dcd96d21466..a3bb95963e2 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -100,27 +100,12 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) if (idl_global->dcps_sequence_type_defined (node->full_name ())) { - // generate the sequence declaration as if it was native. This - // to satisfy DDS - - // strip the "Seq" ending to get the sample's name - const char * node_name = node->full_name (); - const size_t max_name_length = 2000; - if (ACE_OS::strlen (node_name) >= max_name_length) - { - return -1; - } - char sample_name[max_name_length]; - ACE_OS::strncpy (sample_name, - node_name, - ACE_OS::strlen (node_name) - 3); - sample_name[ACE_OS::strlen (node_name) - 3] = '\0'; - + // Special Implementation for OpenDDS *os << be_nl_2 << "typedef ::TAO::DCPS::ZeroCopyDataSeq< " - << sample_name + << node->base_type ()->full_name () << ", DCPS_ZERO_COPY_SEQ_DEFAULT_SIZE> " - << node->local_name () + << node->original_local_name () << ";" << be_nl; } else diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 1943bbdf9d3..1ba5cf3331e 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -277,6 +277,8 @@ DRV_cpp_init () DRV_cpp_putarg (version_option); DRV_cpp_putarg ("-I."); + DRV_cpp_putarg ("-D__TAO_IDL_DCPS_DATA_SEQUENCE_TYPE_SUPPORTS_CXX_KEYWORDS"); + const char *platform_cpp_args = FE_get_cpp_args_from_env (); diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index de5905aea50..9697f204f2f 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -857,6 +857,8 @@ enum TAO_Policy_Scope # define TAO_DEFAULT_COLLOCATION_STRATEGY TAO_COLLOCATION_THRU_POA #endif +#define TAO_IDL_DCPS_DATA_SEQUENCE_TYPE_SUPPORTS_CXX_KEYWORDS + TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" |