# HG changeset patch # User Alain Mazy # Date 1583830158 -3600 # Node ID 6cd4b7724c3d59ff54228db50f323810a6a46a67 # Parent ae31ba2b09a641c18b882fbc3104a2400dac74e0 tentative fix of std::unique_ptr compilation issue for VS2015 diff -r ae31ba2b09a6 -r 6cd4b7724c3d Core/Compatibility.h --- 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