comparison Core/Enumerations.h @ 3364:ea299aca479b

Added workaround for lack of support of __cplusplus in Visual Studio
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 07 May 2019 13:21:41 +0200
parents 45e1631febbb
children 56ea9c476dba
comparison
equal deleted inserted replaced
3363:cf4e35fef742 3364:ea299aca479b
47 47
48 48
49 // Macros "ORTHANC_OVERRIDE" and "ORTHANC_FINAL" wrap the "override" 49 // Macros "ORTHANC_OVERRIDE" and "ORTHANC_FINAL" wrap the "override"
50 // and "final" keywords introduced in C++11, to do compile-time 50 // and "final" keywords introduced in C++11, to do compile-time
51 // checking of virtual methods 51 // checking of virtual methods
52 // The __cplusplus macro is broken in Visual Studio up to 15.6 and, in
53 // later versions, require the usage of the /Zc:__cplusplus flag
54 // We thus use an alternate way of checking for 'override' support
55 #ifdef ORTHANC_OVERRIDE_SUPPORTED
56 #error ORTHANC_OVERRIDE_SUPPORTED cannot be defined at this point
57 #endif
58
52 #if __cplusplus >= 201103L 59 #if __cplusplus >= 201103L
53 // C++11 is enabled 60 # define ORTHANC_OVERRIDE_SUPPORTED 1
54 # define ORTHANC_OVERRIDE override 61 #else
62 # ifdef _MSC_VER
63 # if _MSC_VER >= 1600
64 # define ORTHANC_OVERRIDE_SUPPORTED 1
65 # endif
66 # endif
67 #endif
68
69 #if ORTHANC_OVERRIDE_SUPPORTED
70 // The override keyword (C++11) is enabled
71 # define ORTHANC_OVERRIDE override
55 # define ORTHANC_FINAL final 72 # define ORTHANC_FINAL final
56 #else 73 #else
57 // C++11 is disabled 74 // The override keyword (C++11) is not available
58 # define ORTHANC_OVERRIDE 75 # define ORTHANC_OVERRIDE
59 # define ORTHANC_FINAL 76 # define ORTHANC_FINAL
60 #endif 77 #endif
61
62 78
63 namespace Orthanc 79 namespace Orthanc
64 { 80 {
65 static const char* const URI_SCHEME_PREFIX_BINARY = "data:application/octet-stream;base64,"; 81 static const char* const URI_SCHEME_PREFIX_BINARY = "data:application/octet-stream;base64,";
66 82