Mercurial > hg > orthanc
comparison OrthancFramework/Sources/Enumerations.h @ 4202:2007ab69ac16
moving ORTHANC_FORCE_INLINE and ORTHANC_OVERRIDE from Enumerations.h to Compatibility.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Sep 2020 08:35:11 +0200 |
parents | f0d81320f17f |
children | c70df925151e |
comparison
equal
deleted
inserted
replaced
4201:2d5209153b32 | 4202:2007ab69ac16 |
---|---|
24 | 24 |
25 #include "OrthancFramework.h" | 25 #include "OrthancFramework.h" |
26 | 26 |
27 #include <string> | 27 #include <string> |
28 | 28 |
29 | |
30 // Macro "ORTHANC_FORCE_INLINE" forces a function/method to be inlined | |
31 #if defined(_MSC_VER) | |
32 # define ORTHANC_FORCE_INLINE __forceinline | |
33 #elif defined(__GNUC__) || defined(__clang__) || defined(__EMSCRIPTEN__) | |
34 # define ORTHANC_FORCE_INLINE inline __attribute((always_inline)) | |
35 #else | |
36 # error Please support your compiler here | |
37 #endif | |
38 | |
39 | |
40 // Macros "ORTHANC_OVERRIDE" and "ORTHANC_FINAL" wrap the "override" | |
41 // and "final" keywords introduced in C++11, to do compile-time | |
42 // checking of virtual methods | |
43 // The __cplusplus macro is broken in Visual Studio up to 15.6 and, in | |
44 // later versions, require the usage of the /Zc:__cplusplus flag | |
45 // We thus use an alternate way of checking for 'override' support | |
46 #ifdef ORTHANC_OVERRIDE_SUPPORTED | |
47 #error ORTHANC_OVERRIDE_SUPPORTED cannot be defined at this point | |
48 #endif | |
49 | |
50 #if __cplusplus >= 201103L | |
51 # define ORTHANC_OVERRIDE_SUPPORTED 1 | |
52 #else | |
53 # ifdef _MSC_VER | |
54 # if _MSC_VER >= 1600 | |
55 # define ORTHANC_OVERRIDE_SUPPORTED 1 | |
56 # endif | |
57 # endif | |
58 #endif | |
59 | |
60 #if ORTHANC_OVERRIDE_SUPPORTED | |
61 // The override keyword (C++11) is enabled | |
62 # define ORTHANC_OVERRIDE override | |
63 # define ORTHANC_FINAL final | |
64 #else | |
65 // The override keyword (C++11) is not available | |
66 # define ORTHANC_OVERRIDE | |
67 # define ORTHANC_FINAL | |
68 #endif | |
69 | 29 |
70 namespace Orthanc | 30 namespace Orthanc |
71 { | 31 { |
72 static const char* const URI_SCHEME_PREFIX_BINARY = "data:application/octet-stream;base64,"; | 32 static const char* const URI_SCHEME_PREFIX_BINARY = "data:application/octet-stream;base64,"; |
73 | 33 |