changeset 3714:e9029cb94d7c

fix unique_ptr cpp compat for MSVC
author Alain Mazy <alain@mazy.be>
date Mon, 02 Mar 2020 16:18:11 +0100
parents 2a170a8f1faf
children 0504cc83486a ae0e3fd609df
files Core/Compatibility.h
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Compatibility.h	Mon Mar 02 15:32:45 2020 +0100
+++ b/Core/Compatibility.h	Mon Mar 02 16:18:11 2020 +0100
@@ -33,7 +33,23 @@
 
 #pragma once
 
-#if __cplusplus < 201103L
+// __cplusplus cannot be used in Visual C++ versions older than 1914
+#if (defined _MSC_VER) && (_MSC_VER < 1914)
+#  if _MSC_VER < 1900
+#    define ORTHANC_Cxx03_DETECTED 1
+#  else
+#    define ORTHANC_Cxx03_DETECTED 0
+#  endif
+#else
+#  if __cplusplus < 201103L
+#    define ORTHANC_Cxx03_DETECTED 1
+#  else
+#    define ORTHANC_Cxx03_DETECTED 0
+#  endif
+#endif
+
+
+#if ORTHANC_Cxx03_DETECTED == 1
 /**
  * "std::unique_ptr" was introduced in C++11, and "std::auto_ptr" was
  * removed in C++17. We emulate "std::auto_ptr" using boost: "The