diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-04-26 21:57:47 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-04-27 13:00:11 -0500 |
commit | 263e285c83a4b21691121e7697daf71792fcba3d (patch) | |
tree | 2fa4e41277e7ba03b70f68a8bce162eb380fd5d0 | |
parent | e16811a6be39b1fb301a944046ed4f806930fa65 (diff) | |
download | ATCD-263e285c83a4b21691121e7697daf71792fcba3d.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 ceb9f1e42d3..e9ae39425eb 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 51e9804590c..a1812d582fc 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -277,6 +277,8 @@ DRV_cpp_init (void) 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 86530c3e4e7..4bf63c1fd54 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -861,6 +861,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" |