changeset 3732:6cd4b7724c3d

tentative fix of std::unique_ptr compilation issue for VS2015
author Alain Mazy <alain@mazy.be>
date Tue, 10 Mar 2020 09:49:18 +0100
parents ae31ba2b09a6
children c1550e710410 c38b82bb6fd3
files Core/Compatibility.h
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Compatibility.h	Mon Mar 09 15:06:22 2020 +0100
+++ b/Core/Compatibility.h	Tue Mar 10 09:49:18 2020 +0100
@@ -40,12 +40,20 @@
 
 #if (defined _MSC_VER)
 //#  pragma message("_MSC_VER = " Orthanc_Compatibility_h_STR1(_MSC_VER))
+//#  pragma message("_MSVC_LANG = " Orthanc_Compatibility_h_STR1(_MSVC_LANG))
 // The __cplusplus macro cannot be used in Visual C++ < 1914 (VC++ 15.7)
 // However, even in recent versions, __cplusplus will only be correct (that is,
 // correctly defines the supported C++ version) if a special flag is passed to
 // the compiler ("/Zc:__cplusplus")
 // To make this header more robust, we use the _MSVC_LANG equivalent macro.
-#  if (defined _MSVC_LANG) && (_MSVC_LANG >= 201103L)
+
+#  if _MSC_VER > 1900
+#    if (defined _MSVC_LANG) && (_MSVC_LANG >= 201103L)
+#      define ORTHANC_Cxx03_DETECTED 0
+#    else
+#      define ORTHANC_Cxx03_DETECTED 1
+#    endif
+#  elif _MSC_VER > 1800
 #    define ORTHANC_Cxx03_DETECTED 0
 #  else
 #    define ORTHANC_Cxx03_DETECTED 1