diff options
author | Jose <jose@zeroc.com> | 2018-04-18 00:14:25 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-04-18 00:21:06 +0200 |
commit | bd7f64820c89cd535023113af08dc20fc7f41ee7 (patch) | |
tree | 69fd73adf4b0c8b33a732102f965ddff5737d860 | |
parent | IceGridGUI macOS JDK 10 build fixes (diff) | |
download | ice-bd7f64820c89cd535023113af08dc20fc7f41ee7.tar.bz2 ice-bd7f64820c89cd535023113af08dc20fc7f41ee7.tar.xz ice-bd7f64820c89cd535023113af08dc20fc7f41ee7.zip |
Fixes for C++17 compatibility
Avoid using functions that have been removed in C++17
Added ICE_CPLUSPLUS macro to workaround __cplusplus not
always set with VC++ compiler
Fixes #24
-rw-r--r-- | cpp/include/Ice/Functional.h | 3 | ||||
-rw-r--r-- | cpp/include/Ice/Proxy.h | 8 | ||||
-rw-r--r-- | cpp/include/IceUtil/Config.h | 6 | ||||
-rw-r--r-- | cpp/include/IceUtil/Timer.h | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/cpp/include/Ice/Functional.h b/cpp/include/Ice/Functional.h index 3241df1ceb7..96f1d2d24e9 100644 --- a/cpp/include/Ice/Functional.h +++ b/cpp/include/Ice/Functional.h @@ -10,6 +10,8 @@ #ifndef ICE_FUNCTIONAL_H #define ICE_FUNCTIONAL_H +# if !defined(ICE_CPP11_MAPPING) || defined(ICE_BUILDING_SRC) + #include <IceUtil/Functional.h> #include <Ice/Handle.h> @@ -137,4 +139,5 @@ secondConstVoidMemFun1(void (T::*p)(A) const) } +# endif #endif diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index feb9f295e5c..dc1c073c04b 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -1454,7 +1454,7 @@ ICE_API bool proxyIdentityAndFacetEqual(const ::std::shared_ptr<ObjectPrx>& lhs, * compares less than the identity in rhs, false otherwise. * \headerfile Ice/Ice.h */ -#if (__cplusplus >= 201703L) +#if (ICE_CPLUSPLUS >= 201703L) struct ProxyIdentityLess #else struct ProxyIdentityLess : std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&> @@ -1471,7 +1471,7 @@ struct ProxyIdentityLess : std::binary_function<bool, ::std::shared_ptr<ObjectPr * compares equal to the identity in rhs, false otherwise. * \headerfile Ice/Ice.h */ -#if (__cplusplus >= 201703L) +#if (ICE_CPLUSPLUS >= 201703L) struct ProxyIdentityEqual #else struct ProxyIdentityEqual : std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&> @@ -1488,7 +1488,7 @@ struct ProxyIdentityEqual : std::binary_function<bool, ::std::shared_ptr<ObjectP * and facet in lhs compare less than the identity and facet in rhs, false otherwise. * \headerfile Ice/Ice.h */ -#if (__cplusplus >= 201703L) +#if (ICE_CPLUSPLUS >= 201703L) struct ProxyIdentityAndFacetLess #else struct ProxyIdentityAndFacetLess : std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&> @@ -1505,7 +1505,7 @@ struct ProxyIdentityAndFacetLess : std::binary_function<bool, ::std::shared_ptr< * and facet in lhs compare equal to the identity and facet in rhs, false otherwise. * \headerfile Ice/Ice.h */ -#if (__cplusplus >= 201703L) +#if (ICE_CPLUSPLUS >= 201703L) struct ProxyIdentityAndFacetEqual #else struct ProxyIdentityAndFacetEqual : std::binary_function<bool, ::std::shared_ptr<ObjectPrx>&, ::std::shared_ptr<ObjectPrx>&> diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 01028df265a..71eb5623b82 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -158,6 +158,12 @@ # define ICE_HAS_THREAD_SAFE_LOCAL_STATIC #endif +#if defined(_MSVC_LANG) +# define ICE_CPLUSPLUS _MSVC_LANG +#else +# define ICE_CPLUSPLUS __cplusplus +#endif + // // Compiler extensions to export and import symbols: see the documentation // for Visual Studio, Solaris Studio and GCC. diff --git a/cpp/include/IceUtil/Timer.h b/cpp/include/IceUtil/Timer.h index 755315c6839..91ac93a4bcc 100644 --- a/cpp/include/IceUtil/Timer.h +++ b/cpp/include/IceUtil/Timer.h @@ -104,7 +104,7 @@ protected: bool _destroyed; std::set<Token> _tokens; -#if (__cplusplus >= 201703L) +#if (ICE_CPLUSPLUS >= 201703L) class TimerTaskCompare #else class TimerTaskCompare : public std::binary_function<TimerTaskPtr, TimerTaskPtr, bool> |