summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-04-18 00:14:25 +0200
committerJose <jose@zeroc.com>2018-04-18 00:21:06 +0200
commitbd7f64820c89cd535023113af08dc20fc7f41ee7 (patch)
tree69fd73adf4b0c8b33a732102f965ddff5737d860 /cpp/include/IceUtil
parentIceGridGUI macOS JDK 10 build fixes (diff)
downloadice-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
Diffstat (limited to 'cpp/include/IceUtil')
-rw-r--r--cpp/include/IceUtil/Config.h6
-rw-r--r--cpp/include/IceUtil/Timer.h2
2 files changed, 7 insertions, 1 deletions
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>