summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/DeprecatedStringConverter.h8
-rw-r--r--cpp/include/Ice/LocalObject.h2
-rw-r--r--cpp/include/Ice/Object.h2
-rw-r--r--cpp/include/Ice/Proxy.h2
-rw-r--r--cpp/include/IceSSL/Plugin.h2
-rw-r--r--cpp/include/IceUtil/Config.h17
-rw-r--r--cpp/src/Ice/Initialize.cpp8
-rw-r--r--cpp/src/Ice/StreamI.cpp8
-rw-r--r--cpp/src/slice2cpp/Gen.cpp7
9 files changed, 28 insertions, 28 deletions
diff --git a/cpp/include/Ice/DeprecatedStringConverter.h b/cpp/include/Ice/DeprecatedStringConverter.h
index 54a957dd9fc..d0b09819073 100644
--- a/cpp/include/Ice/DeprecatedStringConverter.h
+++ b/cpp/include/Ice/DeprecatedStringConverter.h
@@ -21,16 +21,16 @@ typedef IceUtil::StringConverterPtr StringConverterPtr;
typedef IceUtil::WstringConverterPtr WstringConverterPtr;
-ICE_DEPRECATED_API std::string
+ICE_DEPRECATED_API("is deprecated, use IceUtil::nativeToUTF8(const std::string&, const StringConverterPtr&) instead") std::string
nativeToUTF8(const StringConverterPtr&, const std::string&);
-ICE_DEPRECATED_API std::string
+ICE_DEPRECATED_API("is deprecated, use IceUtil::nativeToUTF8(const std::string&, const StringConverterPtr&) instead") std::string
nativeToUTF8(const CommunicatorPtr&, const std::string&);
-ICE_DEPRECATED_API std::string
+ICE_DEPRECATED_API("is deprecated, use IceUtil::UTF8ToNative(const std::string&, const StringConverterPtr&) instead") std::string
UTF8toNative(const StringConverterPtr&, const std::string&);
-ICE_DEPRECATED_API std::string
+ICE_DEPRECATED_API("is deprecated, use IceUtil::UTF8ToNative(const std::string&, const StringConverterPtr&) instead") std::string
UTF8ToNative(const CommunicatorPtr&, const std::string&);
}
diff --git a/cpp/include/Ice/LocalObject.h b/cpp/include/Ice/LocalObject.h
index b112764e0dc..ae73f6090c9 100644
--- a/cpp/include/Ice/LocalObject.h
+++ b/cpp/include/Ice/LocalObject.h
@@ -29,7 +29,7 @@ public:
virtual bool operator==(const LocalObject&) const;
virtual bool operator<(const LocalObject&) const;
- ICE_DEPRECATED_API ::Ice::Int ice_getHash() const
+ ICE_DEPRECATED_API("is deprecated") ::Ice::Int ice_getHash() const
{
return internal_getHash();
}
diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h
index 2f2ec7f5e42..58d8d976014 100644
--- a/cpp/include/Ice/Object.h
+++ b/cpp/include/Ice/Object.h
@@ -66,7 +66,7 @@ public:
virtual bool operator==(const Object&) const;
virtual bool operator<(const Object&) const;
- virtual ICE_DEPRECATED_API Int ice_getHash() const;
+ virtual ICE_DEPRECATED_API("is deprecated") Int ice_getHash() const;
virtual bool ice_isA(const std::string&, const Current& = Current()) const;
DispatchStatus ___ice_isA(IceInternal::Incoming&, const Current&);
diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h
index 5b3f5151722..820fd28ccfe 100644
--- a/cpp/include/Ice/Proxy.h
+++ b/cpp/include/Ice/Proxy.h
@@ -232,7 +232,7 @@ public:
bool operator!=(const Object&) const;
bool operator<(const Object&) const;
- ICE_DEPRECATED_API ::Ice::Int ice_getHash() const;
+ ICE_DEPRECATED_API("is deprecated") ::Ice::Int ice_getHash() const;
::Ice::CommunicatorPtr ice_getCommunicator() const;
diff --git a/cpp/include/IceSSL/Plugin.h b/cpp/include/IceSSL/Plugin.h
index 9b563eaae2f..70b318806e8 100644
--- a/cpp/include/IceSSL/Plugin.h
+++ b/cpp/include/IceSSL/Plugin.h
@@ -286,7 +286,7 @@ public:
// that require a certificate and not just a public key to verify
// the certificate signature.
//
- ICE_DEPRECATED_API bool verify(const PublicKeyPtr&) const;
+ ICE_DEPRECATED_API("is deprecated, use verify(const CertificatePtr&) instead") bool verify(const PublicKeyPtr&) const;
#endif
//
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 1332b20c9ea..6db11205efa 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -131,11 +131,22 @@
#if defined(_MSC_VER)
-# define ICE_DEPRECATED_API __declspec(deprecated)
+# define ICE_DEPRECATED_API(msg) __declspec(deprecated(msg))
+#elif defined(__clang__)
+# if __has_extension(attribute_deprecated_with_message)
+# define ICE_DEPRECATED_API(msg) __attribute__((deprecated(msg)))
+# else
+# define ICE_DEPRECATED_API(msg) __attribute__((deprecated))
+# endif
#elif defined(__GNUC__)
-# define ICE_DEPRECATED_API __attribute__((deprecated))
+# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+// The message option was introduced in GCC 4.5
+# define ICE_DEPRECATED_API(msg) __attribute__((deprecated(msg)))
+# else
+# define ICE_DEPRECATED_API(msg) __attribute__((deprecated))
+# endif
#else
-# define ICE_DEPRECATED_API /**/
+# define ICE_DEPRECATED_API(msg) /**/
#endif
#ifdef _WIN32
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index 74e9eb62577..5702d76c51d 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -7,14 +7,6 @@
//
// **********************************************************************
-//
-// We disable deprecation warning here, to allow clean compilation of
-// of deprecated methods from StreamI.h.
-//
-#ifdef _MSC_VER
-# pragma warning( disable : 4996 )
-#endif
-
#include <IceUtil/DisableWarnings.h>
#include <IceUtil/ArgVector.h>
#include <Ice/CommunicatorI.h>
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index e5a9920dd23..7537425a21c 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -7,14 +7,6 @@
//
// **********************************************************************
-//
-// We disable deprecation warning here, to allow clean compilation of
-// of deprecated methods.
-//
-#ifdef _MSC_VER
-# pragma warning( disable : 4996 )
-#endif
-
#include <Ice/StreamI.h>
#include <Ice/Instance.h>
#include <Ice/DefaultsAndOverrides.h>
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index c26c89ac518..1f8c2846bd3 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -36,7 +36,12 @@ getDeprecateSymbol(const ContainedPtr& p1, const ContainedPtr& p2)
if(p1->findMetaData("deprecate", deprecateMetadata) ||
(p2 != 0 && p2->findMetaData("deprecate", deprecateMetadata)))
{
- deprecateSymbol = "ICE_DEPRECATED_API ";
+ string msg = "is deprecated";
+ if(deprecateMetadata.find("deprecate:") == 0 && deprecateMetadata.size() > 10)
+ {
+ msg = deprecateMetadata.substr(10);
+ }
+ deprecateSymbol = "ICE_DEPRECATED_API(\"" + msg + "\") ";
}
return deprecateSymbol;
}