Merge branch 'feature/detect_unsupported_compilers' into develop
- added error macros to exclude unsupported compilers
This commit is contained in:
commit
8f9f561742
2 changed files with 26 additions and 0 deletions
13
src/json.hpp
13
src/json.hpp
|
@ -54,6 +54,19 @@ SOFTWARE.
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
// exclude unsupported compilers
|
||||||
|
#if defined(__clang__)
|
||||||
|
#define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
|
#if CLANG_VERSION < 30400
|
||||||
|
#error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
|
||||||
|
#endif
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||||
|
#if GCC_VERSION < 40900
|
||||||
|
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// disable float-equal warnings on GCC/clang
|
// disable float-equal warnings on GCC/clang
|
||||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
|
|
@ -54,6 +54,19 @@ SOFTWARE.
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
// exclude unsupported compilers
|
||||||
|
#if defined(__clang__)
|
||||||
|
#define CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||||
|
#if CLANG_VERSION < 30400
|
||||||
|
#error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
|
||||||
|
#endif
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||||
|
#if GCC_VERSION < 40900
|
||||||
|
#error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// disable float-equal warnings on GCC/clang
|
// disable float-equal warnings on GCC/clang
|
||||||
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
|
Loading…
Reference in a new issue