add clang support in JSON_HAS_CPP_17 macro
This commit is contained in:
parent
9212590764
commit
0e93f81ba4
@ -20,10 +20,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// C++ language standard detection
|
// C++ language standard detection
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
// fix for issue #464
|
||||||
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(_HAS_CXX17) && _HAS_CXX17 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 5 && __clang_minor__ >= 0)
|
||||||
#define JSON_HAS_CPP_17
|
#define JSON_HAS_CPP_17
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
|
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
||||||
|
(defined(_HAS_CXX14) && _HAS_CXX14 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 4)
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -2048,10 +2048,15 @@ JSON_HEDLEY_DIAGNOSTIC_POP
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// C++ language standard detection
|
// C++ language standard detection
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
// fix for issue #464
|
||||||
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(_HAS_CXX17) && _HAS_CXX17 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 5 && __clang_minor__ >= 0)
|
||||||
#define JSON_HAS_CPP_17
|
#define JSON_HAS_CPP_17
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
|
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
||||||
|
(defined(_HAS_CXX14) && _HAS_CXX14 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 4)
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -41,11 +41,15 @@ using nlohmann::json;
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <valarray>
|
#include <valarray>
|
||||||
|
// fix for issue #464
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(_HAS_CXX17) && _HAS_CXX17 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 5 && __clang_minor__ >= 0)
|
||||||
#define JSON_HAS_CPP_17
|
#define JSON_HAS_CPP_17
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
|
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
||||||
|
(defined(_HAS_CXX14) && _HAS_CXX14 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 4)
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -31,11 +31,15 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using nlohmann::json;
|
using nlohmann::json;
|
||||||
|
// fix for issue #464
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(_HAS_CXX17) && _HAS_CXX17 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 5 && __clang_minor__ >= 0)
|
||||||
#define JSON_HAS_CPP_17
|
#define JSON_HAS_CPP_17
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1)
|
#elif (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
||||||
|
(defined(_HAS_CXX14) && _HAS_CXX14 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ >= 4)
|
||||||
#define JSON_HAS_CPP_14
|
#define JSON_HAS_CPP_14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,10 @@ using nlohmann::json;
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <test_data.hpp>
|
#include <test_data.hpp>
|
||||||
|
// fix for issue #464
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
|
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||||
|
(defined(_HAS_CXX17) && _HAS_CXX17 == 1) || \
|
||||||
|
(defined(__clang__) && __clang_major__ == 5 && __clang_minor__ >= 0)
|
||||||
#define JSON_HAS_CPP_17
|
#define JSON_HAS_CPP_17
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user