diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/include/Ice/Exception.h | 46 | ||||
-rw-r--r-- | cpp/include/IceSSL/Plugin.h | 12 | ||||
-rw-r--r-- | cpp/include/IceUtil/Exception.h | 35 | ||||
-rw-r--r-- | cpp/include/IceUtil/Options.h | 8 | ||||
-rw-r--r-- | cpp/src/Ice/CountDownLatch.cpp | 20 | ||||
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 63 | ||||
-rw-r--r-- | cpp/src/IceDB/IceDB.cpp | 16 | ||||
-rw-r--r-- | cpp/src/IceDB/IceDB.h | 12 | ||||
-rw-r--r-- | cpp/src/IceSSL/Certificate.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceStorm/Parser.cpp | 18 | ||||
-rw-r--r-- | cpp/src/IceUtil/Options.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceUtil/UtilException.cpp | 51 | ||||
-rw-r--r-- | cpp/src/IceXML/Parser.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceXML/Parser.h | 4 | ||||
-rw-r--r-- | cpp/src/Slice/FileTracker.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Slice/FileTracker.h | 4 | ||||
-rw-r--r-- | cpp/test/Ice/interceptor/MyObjectI.cpp | 54 | ||||
-rw-r--r-- | cpp/test/Ice/interceptor/MyObjectI.h | 8 | ||||
-rw-r--r-- | cpp/test/Ice/plugin/Plugin.cpp | 4 | ||||
-rw-r--r-- | cpp/test/include/TestCommon.h | 4 |
20 files changed, 233 insertions, 160 deletions
diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h index e5810ca16d0..269feb41516 100644 --- a/cpp/include/Ice/Exception.h +++ b/cpp/include/Ice/Exception.h @@ -44,32 +44,32 @@ class ICE_API LocalException : public IceUtil::Exception public: LocalException(const char*, int); - virtual ~LocalException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~LocalException() throw(); +#endif - virtual std::string ice_id() const = 0; static const std::string& ice_staticId(); + #ifndef ICE_CPP11_MAPPING virtual LocalException* ice_clone() const = 0; #endif - virtual void ice_throw() const = 0; }; class ICE_API UserException : public IceUtil::Exception { public: - virtual std::string ice_id() const = 0; static const std::string& ice_staticId(); -#ifndef ICE_CPP11_MAPPING - virtual UserException* ice_clone() const = 0; -#endif - virtual void ice_throw() const = 0; virtual void __write(::Ice::OutputStream*) const; virtual void __read(::Ice::InputStream*); virtual bool __usesClasses() const; +#ifndef ICE_CPP11_MAPPING + virtual UserException* ice_clone() const = 0; +#endif + protected: virtual void __writeImpl(::Ice::OutputStream*) const {}; @@ -81,33 +81,17 @@ class ICE_API SystemException : public IceUtil::Exception public: SystemException(const char*, int); - virtual ~SystemException() ICE_NOEXCEPT; - virtual std::string ice_id() const = 0; +#ifndef ICE_CPP11_COMPILER + virtual ~SystemException() throw(); +#endif + + static const std::string& ice_staticId(); + #ifndef ICE_CPP11_MAPPING virtual SystemException* ice_clone() const = 0; #endif - virtual void ice_throw() const = 0; -}; -#if defined(__SUNPRO_CC) -// -// COMPILERFIX: With Sun CC the presence of the overloaded operator -// in ProxyHandle.h -// -// template<class OStream, class Y> -// OStream& operator<<(OStream& os, ::IceInternal::ProxyHandle<Y> p) -// -// prevents the compiler from using the overloaded operator for -// Exception in IceUtil/Exception.h -// -// std::ostream& operator<<(std::ostream&, const Exception&); -// -// thus causing a compile error and making these overloads necessary. -// -ICE_API std::ostream& operator<<(std::ostream&, const LocalException&); -ICE_API std::ostream& operator<<(std::ostream&, const UserException&); -ICE_API std::ostream& operator<<(std::ostream&, const SystemException&); -#endif +}; } diff --git a/cpp/include/IceSSL/Plugin.h b/cpp/include/IceSSL/Plugin.h index fb4602645d4..91c25e0e1a2 100644 --- a/cpp/include/IceSSL/Plugin.h +++ b/cpp/include/IceSSL/Plugin.h @@ -106,7 +106,9 @@ class ICE_SSL_API CertificateReadException : public IceUtil::Exception public: CertificateReadException(const char*, int, const std::string&); - virtual ~CertificateReadException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~CertificateReadException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING virtual CertificateReadException* ice_clone() const; @@ -131,7 +133,9 @@ public: #ifdef ICE_USE_SECURE_TRANSPORT CertificateEncodingException(const char*, int, CFErrorRef); #endif - virtual ~CertificateEncodingException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~CertificateEncodingException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING virtual CertificateEncodingException* ice_clone() const; @@ -153,7 +157,9 @@ class ICE_SSL_API ParseException : public IceUtil::Exception public: ParseException(const char*, int, const std::string&); - virtual ~ParseException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~ParseException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING virtual ParseException* ice_clone() const; diff --git a/cpp/include/IceUtil/Exception.h b/cpp/include/IceUtil/Exception.h index 65a003b85bb..2e9dd34af3f 100644 --- a/cpp/include/IceUtil/Exception.h +++ b/cpp/include/IceUtil/Exception.h @@ -24,19 +24,20 @@ public: Exception(); Exception(const char*, int); - - virtual ~Exception() ICE_NOEXCEPT; - virtual std::string ice_id() const; +#ifndef ICE_CPP11_COMPILER + virtual ~Exception() throw(); +#endif + virtual std::string ice_id() const = 0; virtual void ice_print(std::ostream&) const; virtual const char* what() const ICE_NOEXCEPT; #ifdef ICE_CPP11_MAPPING std::exception_ptr ice_clone() const; #else + virtual Exception* ice_clone() const = 0; ICE_DEPRECATED_API("ice_name() is deprecated, use ice_id() instead.") std::string ice_name() const; - virtual Exception* ice_clone() const; #endif - virtual void ice_throw() const; + virtual void ice_throw() const = 0; const char* ice_file() const; int ice_line() const; @@ -57,7 +58,9 @@ class ICE_API NullHandleException : public Exception public: NullHandleException(const char*, int); - virtual ~NullHandleException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~NullHandleException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING virtual NullHandleException* ice_clone() const; @@ -71,7 +74,9 @@ public: IllegalArgumentException(const char*, int); IllegalArgumentException(const char*, int, const std::string&); - virtual ~IllegalArgumentException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~IllegalArgumentException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING @@ -95,7 +100,9 @@ public: IllegalConversionException(const char*, int); IllegalConversionException(const char*, int, const std::string&); - virtual ~IllegalConversionException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~IllegalConversionException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING @@ -134,7 +141,9 @@ class ICE_API FileLockException : public Exception public: FileLockException(const char*, int, int, const std::string&); - virtual ~FileLockException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~FileLockException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING @@ -156,7 +165,9 @@ class ICE_API OptionalNotSetException : public Exception public: OptionalNotSetException(const char*, int); - virtual ~OptionalNotSetException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~OptionalNotSetException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING virtual OptionalNotSetException* ice_clone() const; @@ -170,7 +181,9 @@ class ICE_API IconvInitializationException : public Exception public: IconvInitializationException(const char*, int, const std::string&); - virtual ~IconvInitializationException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~IconvInitializationException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING diff --git a/cpp/include/IceUtil/Options.h b/cpp/include/IceUtil/Options.h index 2826b7e29bd..63301165295 100644 --- a/cpp/include/IceUtil/Options.h +++ b/cpp/include/IceUtil/Options.h @@ -27,7 +27,9 @@ class ICE_API APIException : public IceUtil::Exception public: APIException(const char*, int, const ::std::string&); - virtual ~APIException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~APIException() throw(); +#endif virtual ::std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING @@ -45,7 +47,9 @@ class ICE_API BadOptException : public IceUtil::Exception public: BadOptException(const char*, int, const ::std::string&); - virtual ~BadOptException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~BadOptException() throw(); +#endif virtual ::std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING diff --git a/cpp/src/Ice/CountDownLatch.cpp b/cpp/src/Ice/CountDownLatch.cpp index cbdd4d5bcf2..eb0422ba7e9 100644 --- a/cpp/src/Ice/CountDownLatch.cpp +++ b/cpp/src/Ice/CountDownLatch.cpp @@ -15,7 +15,7 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) : { if(count < 0) { - throw IceUtil::Exception(__FILE__, __LINE__); + throw IceUtil::IllegalArgumentException(__FILE__, __LINE__, "count must be greather than 0"); } #ifdef _WIN32 @@ -34,12 +34,12 @@ IceUtilInternal::CountDownLatch::CountDownLatch(int count) : { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc); } - + rc = pthread_cond_init(&_cond, 0); if(rc != 0) { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, rc); - } + } #endif } @@ -60,7 +60,7 @@ IceUtilInternal::CountDownLatch::~CountDownLatch() #endif } -void +void IceUtilInternal::CountDownLatch::await() const { #ifdef _WIN32 @@ -72,7 +72,7 @@ IceUtilInternal::CountDownLatch::await() const DWORD rc = WaitForSingleObjectEx(_event, INFINITE, false); # endif assert(rc == WAIT_OBJECT_0 || rc == WAIT_FAILED); - + if(rc == WAIT_FAILED) { throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, GetLastError()); @@ -90,11 +90,11 @@ IceUtilInternal::CountDownLatch::await() const } } unlock(); - + #endif } -void +void IceUtilInternal::CountDownLatch::countDown() { #ifdef _WIN32 @@ -129,10 +129,10 @@ IceUtilInternal::CountDownLatch::countDown() } } unlock(); - + #else unlock(); - + if(broadcast) { int rc = pthread_cond_broadcast(&_cond); @@ -146,7 +146,7 @@ IceUtilInternal::CountDownLatch::countDown() #endif } -int +int IceUtilInternal::CountDownLatch::getCount() const { #ifdef _WIN32 diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 0dd364ca01b..b24d64a6b53 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -102,6 +102,22 @@ throwMarshalException(const char* file, int line, const string& reason) } } +namespace +{ + +const string __Ice__UserException_ids[] = +{ + "::Ice::UserException" +}; + +} + +const std::string& +Ice::UserException::ice_staticId() +{ + return __Ice__UserException_ids[0]; +}; + void Ice::UserException::__write(::Ice::OutputStream* os) const { @@ -129,41 +145,54 @@ Ice::LocalException::LocalException(const char* file, int line) : { } -Ice::LocalException::~LocalException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +Ice::LocalException::~LocalException() throw() { } +#endif + +namespace +{ + +const string __Ice__LocalException_ids[] = +{ + "::Ice::LocalException" +}; + +} + +const std::string& +Ice::LocalException::ice_staticId() +{ + return __Ice__LocalException_ids[0]; +} Ice::SystemException::SystemException(const char* file, int line) : Exception(file, line) { } -Ice::SystemException::~SystemException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +Ice::SystemException::~SystemException() throw() { } +#endif -#if defined(__SUNPRO_CC) -ostream& -Ice::operator<<(ostream& out, const Ice::UserException& ex) +namespace { - ex.ice_print(out); - return out; -} -ostream& -Ice::operator<<(ostream& out, const Ice::LocalException& ex) +const string __Ice__SystemException_ids[] = { - ex.ice_print(out); - return out; + "::Ice::SystemException" +}; + } -ostream& -Ice::operator<<(ostream& out, const Ice::SystemException& ex) +const std::string& +Ice::SystemException::ice_staticId() { - ex.ice_print(out); - return out; + return __Ice__SystemException_ids[0]; } -#endif void Ice::InitializationException::ice_print(ostream& out) const diff --git a/cpp/src/IceDB/IceDB.cpp b/cpp/src/IceDB/IceDB.cpp index 0710e529cf5..85dd9b1cde2 100644 --- a/cpp/src/IceDB/IceDB.cpp +++ b/cpp/src/IceDB/IceDB.cpp @@ -21,9 +21,11 @@ LMDBException::LMDBException(const char* file, int line, int err) : { } -LMDBException::~LMDBException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +LMDBException::~LMDBException() throw() { } +#endif string LMDBException::ice_id() const @@ -64,9 +66,11 @@ KeyTooLongException::KeyTooLongException(const char* file, int line, size_t size { } -KeyTooLongException::~KeyTooLongException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +KeyTooLongException::~KeyTooLongException() throw() { } +#endif string KeyTooLongException::ice_id() const @@ -106,9 +110,11 @@ BadEnvException::BadEnvException(const char* file, int line, size_t size) : { } -BadEnvException::~BadEnvException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +BadEnvException::~BadEnvException() throw() { } +#endif string BadEnvException::ice_id() const @@ -472,11 +478,11 @@ CursorBase::renew(const ReadOnlyTxn& txn) // -// On Windows, we use a default LMDB map size of 10MB, whereas on other platforms +// On Windows, we use a default LMDB map size of 10MB, whereas on other platforms // (Linux, OS X), we use a default of 100MB. // // On Windows, LMDB does not use sparse files and allocates immediately the file -// with the given (max) size. This is why we need a fairly small default map size +// with the given (max) size. This is why we need a fairly small default map size // on Windows, and a larger value on other platforms. size_t diff --git a/cpp/src/IceDB/IceDB.h b/cpp/src/IceDB/IceDB.h index 2af10594176..560f96b0cee 100644 --- a/cpp/src/IceDB/IceDB.h +++ b/cpp/src/IceDB/IceDB.h @@ -53,7 +53,9 @@ class ICE_DB_API LMDBException : public IceUtil::Exception public: LMDBException(const char*, int, int); - virtual ~LMDBException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~LMDBException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; @@ -79,7 +81,9 @@ class ICE_DB_API KeyTooLongException : public IceUtil::Exception public: KeyTooLongException(const char*, int, size_t); - virtual ~KeyTooLongException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~KeyTooLongException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; @@ -103,7 +107,9 @@ class ICE_DB_API BadEnvException : public IceUtil::Exception public: BadEnvException(const char*, int, size_t); - virtual ~BadEnvException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~BadEnvException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp index b00cb4c58ba..61597bdd0fe 100644 --- a/cpp/src/IceSSL/Certificate.cpp +++ b/cpp/src/IceSSL/Certificate.cpp @@ -427,9 +427,11 @@ CertificateReadException::CertificateReadException(const char* file, int line, c { } -CertificateReadException::~CertificateReadException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +CertificateReadException::~CertificateReadException() throw() { } +#endif string CertificateReadException::ice_id() const @@ -467,9 +469,11 @@ CertificateEncodingException::CertificateEncodingException(const char* file, int { } -CertificateEncodingException::~CertificateEncodingException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +CertificateEncodingException::~CertificateEncodingException() throw() { } +#endif string CertificateEncodingException::ice_id() const @@ -669,9 +673,11 @@ ParseException::ParseException(const char* file, int line, const string& r) : { } -ParseException::~ParseException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +ParseException::~ParseException() throw() { } +#endif string ParseException::ice_id() const diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp index 69624991e10..fc00848fe65 100644 --- a/cpp/src/IceStorm/Parser.cpp +++ b/cpp/src/IceStorm/Parser.cpp @@ -38,17 +38,19 @@ namespace class UnknownManagerException : public Exception { public: - + UnknownManagerException(const string& name, const char* file, int line) : Exception(file, line), name(name) { } +#ifndef ICE_CPP11_COMPILER virtual - ~UnknownManagerException() ICE_NOEXCEPT + ~UnknownManagerException() throw() { } +#endif virtual string ice_id() const @@ -61,7 +63,7 @@ public: { return new UnknownManagerException(*this); } - + virtual void ice_throw() const { @@ -157,8 +159,8 @@ Parser::link(const list<string>& args) } try - { - list<string>::const_iterator p = args.begin(); + { + list<string>::const_iterator p = args.begin(); TopicPrx fromTopic = findTopic(*p++); TopicPrx toTopic = findTopic(*p++); @@ -182,7 +184,7 @@ Parser::unlink(const list<string>& args) } try - { + { list<string>::const_iterator p = args.begin(); TopicPrx fromTopic = findTopic(*p++); @@ -405,7 +407,7 @@ Parser::showBanner() } // -// With older flex version <= 2.5.35 YY_INPUT second +// With older flex version <= 2.5.35 YY_INPUT second // paramenter is of type int&, in newer versions it // changes to size_t& // @@ -493,7 +495,7 @@ Parser::getInput(char* buf, size_t& result, size_t maxSize) break; } } - + result = line.length(); if(result > maxSize) { diff --git a/cpp/src/IceUtil/Options.cpp b/cpp/src/IceUtil/Options.cpp index ebfb3eb1208..55615665a11 100644 --- a/cpp/src/IceUtil/Options.cpp +++ b/cpp/src/IceUtil/Options.cpp @@ -20,9 +20,11 @@ IceUtilInternal::APIException::APIException(const char* file, int line, const st { } -IceUtilInternal::APIException::~APIException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtilInternal::APIException::~APIException() throw() { } +#endif string IceUtilInternal::APIException::ice_id() const @@ -66,9 +68,11 @@ IceUtilInternal::BadOptException::BadOptException(const char* file, int line, co { } -IceUtilInternal::BadOptException::~BadOptException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtilInternal::BadOptException::~BadOptException() throw() { } +#endif string IceUtilInternal::BadOptException::ice_id() const @@ -174,7 +178,7 @@ void IceUtilInternal::Options::addOpt(const string& shortOpt, const string& longOpt, ArgType at, string dflt, RepeatType rt) { RecMutex::Lock sync(_m); - + if(parseCalled) { throw APIException(__FILE__, __LINE__, "cannot add options after parse() was called"); @@ -465,7 +469,7 @@ IceUtilInternal::Options::split(const string& line) Int64 ull = 0; string::size_type j; - for(j = i + 1; j < i + 3 && j < l.size() && + for(j = i + 1; j < i + 3 && j < l.size() && isxdigit(static_cast<unsigned char>(c = l[j])); ++j) { ull *= 16; diff --git a/cpp/src/IceUtil/UtilException.cpp b/cpp/src/IceUtil/UtilException.cpp index 7a9cfb9d776..ec15dc7bff7 100644 --- a/cpp/src/IceUtil/UtilException.cpp +++ b/cpp/src/IceUtil/UtilException.cpp @@ -74,7 +74,7 @@ using namespace std; namespace IceUtilInternal { -#ifdef NDEBUG +#ifdef NDEBUG bool ICE_API printStackTraces = false; #else bool ICE_API printStackTraces = true; @@ -578,9 +578,11 @@ IceUtil::Exception::Exception(const char* file, int line) : { } -IceUtil::Exception::~Exception() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::Exception::~Exception() throw() { } +#endif void IceUtil::Exception::ice_print(ostream& out) const @@ -614,12 +616,6 @@ IceUtil::Exception::what() const ICE_NOEXCEPT return ""; } -string -IceUtil::Exception::ice_id() const -{ - return "::IceUtil::Exception"; -} - #ifdef ICE_CPP11_MAPPING exception_ptr IceUtil::Exception::ice_clone() const @@ -642,20 +638,8 @@ IceUtil::Exception::ice_name() const { return ice_id().substr(2); } - -IceUtil::Exception* -IceUtil::Exception::ice_clone() const -{ - return new Exception(*this); -} #endif -void -IceUtil::Exception::ice_throw() const -{ - throw *this; -} - const char* IceUtil::Exception::ice_file() const { @@ -690,9 +674,11 @@ IceUtil::NullHandleException::NullHandleException(const char* file, int line) : } } -IceUtil::NullHandleException::~NullHandleException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::NullHandleException::~NullHandleException() throw() { } +#endif string IceUtil::NullHandleException::ice_id() const @@ -725,9 +711,11 @@ IceUtil::IllegalArgumentException::IllegalArgumentException(const char* file, in { } -IceUtil::IllegalArgumentException::~IllegalArgumentException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::IllegalArgumentException::~IllegalArgumentException() throw() { } +#endif void IceUtil::IllegalArgumentException::ice_print(ostream& out) const @@ -775,8 +763,11 @@ IceUtil::IllegalConversionException::IllegalConversionException(const char* file _reason(reason) {} -IceUtil::IllegalConversionException::~IllegalConversionException() ICE_NOEXCEPT -{} +#ifndef ICE_CPP11_COMPILER +IceUtil::IllegalConversionException::~IllegalConversionException() throw() +{ +} +#endif void IceUtil::IllegalConversionException::ice_print(ostream& out) const @@ -864,9 +855,11 @@ IceUtil::FileLockException::FileLockException(const char* file, int line, int er { } -IceUtil::FileLockException::~FileLockException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::FileLockException::~FileLockException() throw() { } +#endif void IceUtil::FileLockException::ice_print(ostream& os) const @@ -914,9 +907,11 @@ IceUtil::OptionalNotSetException::OptionalNotSetException(const char* file, int } } -IceUtil::OptionalNotSetException::~OptionalNotSetException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::OptionalNotSetException::~OptionalNotSetException() throw() { } +#endif string IceUtil::OptionalNotSetException::ice_id() const @@ -945,9 +940,11 @@ IceUtil::IconvInitializationException::IconvInitializationException(const char* { } -IceUtil::IconvInitializationException::~IconvInitializationException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceUtil::IconvInitializationException::~IconvInitializationException() throw() { } +#endif void IceUtil::IconvInitializationException::ice_print(ostream& out) const diff --git a/cpp/src/IceXML/Parser.cpp b/cpp/src/IceXML/Parser.cpp index 60eb73e3c58..5cae7178956 100644 --- a/cpp/src/IceXML/Parser.cpp +++ b/cpp/src/IceXML/Parser.cpp @@ -28,9 +28,11 @@ IceXML::ParserException::ParserException(const char* file, int line, const strin { } -IceXML::ParserException::~ParserException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +IceXML::ParserException::~ParserException() throw() { } +#endif string IceXML::ParserException::ice_id() const @@ -433,7 +435,7 @@ IceXML::Parser::parse(istream& in, Handler& handler) } if(XML_Parse(parser, buff, static_cast<int>(in.gcount()), isFinal) != 1) { - handler.error(XML_ErrorString(XML_GetErrorCode(parser)), + handler.error(XML_ErrorString(XML_GetErrorCode(parser)), static_cast<int>(XML_GetCurrentLineNumber(parser)), static_cast<int>(XML_GetCurrentColumnNumber(parser))); return; diff --git a/cpp/src/IceXML/Parser.h b/cpp/src/IceXML/Parser.h index 366ca674d89..b44b3cac897 100644 --- a/cpp/src/IceXML/Parser.h +++ b/cpp/src/IceXML/Parser.h @@ -48,7 +48,9 @@ public: ParserException(const std::string&); ParserException(const char*, int, const std::string&); - virtual ~ParserException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~ParserException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp index 09c14f64a34..e57de914e31 100644 --- a/cpp/src/Slice/FileTracker.cpp +++ b/cpp/src/Slice/FileTracker.cpp @@ -23,9 +23,11 @@ Slice::FileException::FileException(const char* file, int line, const string& r) { } -Slice::FileException::~FileException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +Slice::FileException::~FileException() throw() { } +#endif string Slice::FileException::ice_id() const diff --git a/cpp/src/Slice/FileTracker.h b/cpp/src/Slice/FileTracker.h index 1c18c97742f..1826e52a495 100644 --- a/cpp/src/Slice/FileTracker.h +++ b/cpp/src/Slice/FileTracker.h @@ -21,7 +21,9 @@ class FileException : public ::IceUtil::Exception public: FileException(const char*, int, const std::string&); - ~FileException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + ~FileException() throw(); +#endif virtual std::string ice_id() const; virtual void ice_print(std::ostream&) const; #ifndef ICE_CPP11_MAPPING diff --git a/cpp/test/Ice/interceptor/MyObjectI.cpp b/cpp/test/Ice/interceptor/MyObjectI.cpp index 34d803ac5b9..dc20205f3f2 100644 --- a/cpp/test/Ice/interceptor/MyObjectI.cpp +++ b/cpp/test/Ice/interceptor/MyObjectI.cpp @@ -12,7 +12,7 @@ #include <TestCommon.h> #include <IceUtil/IceUtil.h> -using namespace IceUtil; +using namespace IceUtil; using namespace std; MySystemException::MySystemException(const char* file, int line) : @@ -20,9 +20,11 @@ MySystemException::MySystemException(const char* file, int line) : { } -MySystemException::~MySystemException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER +MySystemException::~MySystemException() throw() { } +#endif string MySystemException::ice_id() const @@ -44,17 +46,17 @@ MySystemException::ice_throw() const throw *this; } -int +int MyObjectI::add(int x, int y, const Ice::Current&) { return x + y; } -int +int MyObjectI::addWithRetry(int x, int y, const Ice::Current& current) { Ice::Context::const_iterator p = current.ctx.find("retry"); - + if(p == current.ctx.end() || p->second != "no") { throw Test::RetryException(__FILE__, __LINE__); @@ -62,19 +64,19 @@ MyObjectI::addWithRetry(int x, int y, const Ice::Current& current) return x + y; } -int +int MyObjectI::badAdd(int, int, const Ice::Current&) { throw Test::InvalidInputException(); } -int +int MyObjectI::notExistAdd(int, int, const Ice::Current&) { throw Ice::ObjectNotExistException(__FILE__, __LINE__); } -int +int MyObjectI::badSystemAdd(int, int, const Ice::Current&) { throw MySystemException(__FILE__, __LINE__); @@ -97,7 +99,7 @@ MyObjectI::amdAddAsync(int x, t.detach(); } -void +void MyObjectI::amdAddWithRetryAsync(int x, int y, function<void (int)> response, @@ -113,14 +115,14 @@ MyObjectI::amdAddWithRetryAsync(int x, t.detach(); Ice::Context::const_iterator p = current.ctx.find("retry"); - + if(p == current.ctx.end() || p->second != "no") { throw Test::RetryException(__FILE__, __LINE__); } } -void +void MyObjectI::amdBadAddAsync(int x, int y, function<void (int)>, @@ -143,13 +145,13 @@ MyObjectI::amdBadAddAsync(int x, t.detach(); } -void +void MyObjectI::amdNotExistAddAsync(int x, int y, function<void (int)>, function<void (exception_ptr)> error, const Ice::Current&) -{ +{ thread t( [x, y, error]() { @@ -166,13 +168,13 @@ MyObjectI::amdNotExistAddAsync(int x, t.detach(); } -void +void MyObjectI::amdBadSystemAddAsync(int x, int y, function<void (int)>, function<void (exception_ptr)> error, const Ice::Current&) -{ +{ thread t( [x, y, error]() { @@ -189,13 +191,13 @@ MyObjectI::amdBadSystemAddAsync(int x, t.detach(); } #else -void +void MyObjectI::amdAdd_async(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y, const Ice::Current&) { class ThreadI : public Thread { public: - + ThreadI(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y) : _cb(cb), _x(x), @@ -218,13 +220,13 @@ MyObjectI::amdAdd_async(const Test::AMD_MyObject_amdAddPtr& cb, int x, int y, co thread->start().detach(); } -void +void MyObjectI::amdAddWithRetry_async(const Test::AMD_MyObject_amdAddWithRetryPtr& cb, int x, int y, const Ice::Current& current) { class ThreadI : public Thread { public: - + ThreadI(const Test::AMD_MyObject_amdAddWithRetryPtr& cb, int x, int y) : _cb(cb), _x(x), @@ -247,20 +249,20 @@ MyObjectI::amdAddWithRetry_async(const Test::AMD_MyObject_amdAddWithRetryPtr& cb thread->start().detach(); Ice::Context::const_iterator p = current.ctx.find("retry"); - + if(p == current.ctx.end() || p->second != "no") { throw Test::RetryException(__FILE__, __LINE__); } } -void +void MyObjectI::amdBadAdd_async(const Test::AMD_MyObject_amdBadAddPtr& cb, int, int, const Ice::Current&) { class ThreadI : public Thread { public: - + ThreadI(const Test::AMD_MyObject_amdBadAddPtr& cb) : _cb(cb) { @@ -280,13 +282,13 @@ MyObjectI::amdBadAdd_async(const Test::AMD_MyObject_amdBadAddPtr& cb, int, int, thread->start().detach(); } -void +void MyObjectI::amdNotExistAdd_async(const Test::AMD_MyObject_amdNotExistAddPtr& cb, int, int, const Ice::Current&) { class ThreadI : public Thread { public: - + ThreadI(const Test::AMD_MyObject_amdNotExistAddPtr& cb) : _cb(cb) { @@ -305,13 +307,13 @@ MyObjectI::amdNotExistAdd_async(const Test::AMD_MyObject_amdNotExistAddPtr& cb, thread->start().detach(); } -void +void MyObjectI::amdBadSystemAdd_async(const Test::AMD_MyObject_amdBadSystemAddPtr& cb, int, int, const Ice::Current&) { class ThreadI : public Thread { public: - + ThreadI(const Test::AMD_MyObject_amdBadSystemAddPtr& cb) : _cb(cb) { diff --git a/cpp/test/Ice/interceptor/MyObjectI.h b/cpp/test/Ice/interceptor/MyObjectI.h index f6bb4425bdf..7629d61ca0f 100644 --- a/cpp/test/Ice/interceptor/MyObjectI.h +++ b/cpp/test/Ice/interceptor/MyObjectI.h @@ -15,10 +15,12 @@ class MySystemException : public Ice::SystemException { public: - + MySystemException(const char*, int); - virtual ~MySystemException() ICE_NOEXCEPT; +#ifndef ICE_CPP11_COMPILER + virtual ~MySystemException() throw(); +#endif virtual std::string ice_id() const; #ifndef ICE_CPP11_MAPPING @@ -36,7 +38,7 @@ public: virtual int badAdd(int, int, const Ice::Current&); virtual int notExistAdd(int, int, const Ice::Current&); virtual int badSystemAdd(int, int, const Ice::Current&); - + #ifdef ICE_CPP11_MAPPING virtual void amdAddAsync(int, int, std::function<void (int)>, std::function<void (std::exception_ptr)>, const Ice::Current&); virtual void amdAddWithRetryAsync(int, int, std::function<void (int)>, std::function<void (std::exception_ptr)>, const Ice::Current&); diff --git a/cpp/test/Ice/plugin/Plugin.cpp b/cpp/test/Ice/plugin/Plugin.cpp index 2c1624ffe06..3c4d34a4bc8 100644 --- a/cpp/test/Ice/plugin/Plugin.cpp +++ b/cpp/test/Ice/plugin/Plugin.cpp @@ -59,7 +59,9 @@ class PluginInitializeFailExeption : public std::exception public: PluginInitializeFailExeption() ICE_NOEXCEPT {} - virtual ~PluginInitializeFailExeption() ICE_NOEXCEPT {} +#ifndef ICE_CPP11_COMPILER + virtual ~PluginInitializeFailExeption() throw() {} +#endif virtual const char* what() const ICE_NOEXCEPT { return "PluginInitializeFailExeption"; } }; diff --git a/cpp/test/include/TestCommon.h b/cpp/test/include/TestCommon.h index eb622197fa8..7ec0469f25b 100644 --- a/cpp/test/include/TestCommon.h +++ b/cpp/test/include/TestCommon.h @@ -150,9 +150,11 @@ public: { } - virtual ~TestFailedException() ICE_NOEXCEPT +#ifndef ICE_CPP11_COMPILER + virtual ~TestFailedException() throw() { } +#endif virtual ::std::string ice_id() const { |