diff options
author | Adam Mitz <mitza@objectcomputing.com> | 2021-11-01 12:03:17 -0500 |
---|---|---|
committer | Adam Mitz <mitza@objectcomputing.com> | 2021-11-01 12:03:17 -0500 |
commit | 67e622e4639dbf478df2c009e10e5226e0eaaf45 (patch) | |
tree | 560e7db0f177ff4eb4034ba6bb145c50e242a1e4 /TAO | |
parent | 58754472d3be09f540e6e3632a7175539aa25dba (diff) | |
download | ATCD-67e622e4639dbf478df2c009e10e5226e0eaaf45.tar.gz |
TAO updates for /std:c++20
Note that the C++20 standard library disallows using
wide (wchar_t) strings with narrow iostreams
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/CORBA_String.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/CORBA_String.h | 3 |
4 files changed, 17 insertions, 6 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp index 520709eff1d..3befe5193ec 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp @@ -9,6 +9,8 @@ #include "orbsvcs/Notify/PropertySeq.h" +#include "orbsvcs/orbsvcs/NotifyExtC.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL /*****************************************************************************/ diff --git a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp index 67941639ea2..6aa02a42676 100644 --- a/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp +++ b/TAO/orbsvcs/orbsvcs/Trader/Trader_Interfaces.cpp @@ -205,7 +205,7 @@ lookup_one_type (const char* type, // @@ Would have used Offer_Database::offer_iterator for less // coupling between TAO_Lookup and Offer_Database, but g++ barfs on // that. -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined (ACE_HAS_CPP20) TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator offer_iter (type, offer_database); #else @@ -958,7 +958,7 @@ withdraw_using_constraint (const char *type, // Try to find the map of offers of desired service type. // @@ Again, should be Offer_Database::offer_iterator { -#if defined (_MSC_VER) +#if defined (_MSC_VER) && !defined (ACE_HAS_CPP20) TAO_Offer_Database<MAP_LOCK_TYPE>::offer_iterator offer_iter (type, offer_database); #else diff --git a/TAO/tao/CORBA_String.cpp b/TAO/tao/CORBA_String.cpp index aaa20da44ec..a0fe07ad895 100644 --- a/TAO/tao/CORBA_String.cpp +++ b/TAO/tao/CORBA_String.cpp @@ -31,9 +31,10 @@ istream & operator>> (istream &is, CORBA::String_var &sv) { is.seekg (0, ios::end); - sv = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ())); + std::streamsize const n = is.tellg (); + sv = CORBA::string_alloc (static_cast<CORBA::ULong> (n)); is.seekg (0, ios::beg); - is >> sv.inout (); + is.read (sv.inout (), n); return is; } @@ -48,12 +49,15 @@ istream & operator>> (istream &is, CORBA::String_out &so) { is.seekg (0, ios::end); - so = CORBA::string_alloc (static_cast<CORBA::ULong> (is.tellg ())); + std::streamsize const n = is.tellg (); + so = CORBA::string_alloc (static_cast<CORBA::ULong> (n)); is.seekg (0, ios::beg); - is >> so.ptr (); + is.read (so.ptr (), n); return is; } +#ifndef ACE_HAS_CPP20 + // Until we implement WString support for platforms with a // 4-byte wchar_t, we just define the following to emit // the CORBA::WChars one by one. @@ -136,6 +140,8 @@ operator>> (istream &is, CORBA::WString_out &wso) return is; } +#endif /* ACE_HAS_CPP20 */ + #endif /* ACE_LACKS_IOSTREAM_TOTALLY */ TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/CORBA_String.h b/TAO/tao/CORBA_String.h index 5e308bc9ad2..2338c9a03a4 100644 --- a/TAO/tao/CORBA_String.h +++ b/TAO/tao/CORBA_String.h @@ -273,6 +273,8 @@ TAO_Export ostream & operator<< (ostream &, CORBA::String_out &); TAO_Export istream & operator>> (istream &, CORBA::String_out &); + +# ifndef ACE_HAS_CPP20 TAO_Export ostream & operator<< (ostream &, const CORBA::WString_var &); TAO_Export istream & @@ -281,6 +283,7 @@ TAO_Export ostream & operator<< (ostream &, CORBA::WString_out &); TAO_Export istream & operator>> (istream &, CORBA::WString_out &); +# endif /* ACE_HAS_CPP20 */ # endif /* ACE_LACKS_IOSTREAM_TOTALLY */ |