🚨 fix warning
This commit is contained in:
parent
7543e179ef
commit
7e87863a6d
@ -24,6 +24,13 @@ The diagnostics messages can also be controlled with the CMake option `JSON_Diag
|
||||
|
||||
The library targets C++11, but also supports some features introduced in later C++ versions (e.g., `std::string_view` support for C++17). For these new features, the library implements some preprocessor checks to determine the C++ standard. By defining any of these symbols, the internal check is overridden and the provided C++ version is unconditionally assumed. This can be helpful for compilers that only implement parts of the standard and would be detected incorrectly.
|
||||
|
||||
## `JSON_HAS_FILESYSTEM`, `JSON_HAS_EXPERIMENTAL_FILESYSTEM`
|
||||
|
||||
When compiling with C++17, the library provides conversions from and to `std::filesystem::path`. As compiler support
|
||||
for filesystem is limited, the library tries to detect whether `<filesystem>`/`std::filesystem` (`JSON_HAS_FILESYSTEM`)
|
||||
or `<experimental/filesystem>`/`std::experimental::filesystem` (`JSON_HAS_EXPERIMENTAL_FILESYSTEM`) should be used.
|
||||
To override the built-in check, define `JSON_HAS_FILESYSTEM` or `JSON_HAS_EXPERIMENTAL_FILESYSTEM` to `1`.
|
||||
|
||||
## `JSON_NOEXCEPTION`
|
||||
|
||||
Exceptions can be switched off by defining the symbol `JSON_NOEXCEPTION`.
|
||||
|
||||
@ -37,7 +37,8 @@
|
||||
#define JSON_HAS_CPP_11
|
||||
#endif
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#if defined(__cpp_lib_filesystem)
|
||||
#define JSON_HAS_FILESYSTEM 1
|
||||
#elif defined(__cpp_lib_experimental_filesystem)
|
||||
@ -55,6 +56,7 @@
|
||||
#undef JSON_HAS_FILESYSTEM
|
||||
#undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
|
||||
@ -2325,7 +2325,8 @@ using is_detected_convertible =
|
||||
#define JSON_HAS_CPP_11
|
||||
#endif
|
||||
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#if defined(__cpp_lib_filesystem)
|
||||
#define JSON_HAS_FILESYSTEM 1
|
||||
#elif defined(__cpp_lib_experimental_filesystem)
|
||||
@ -2343,6 +2344,7 @@ using is_detected_convertible =
|
||||
#undef JSON_HAS_FILESYSTEM
|
||||
#undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
|
||||
@ -49,6 +49,7 @@ using ordered_json = nlohmann::ordered_json;
|
||||
#ifdef JSON_HAS_CPP_17
|
||||
#include <variant>
|
||||
|
||||
#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM)
|
||||
#if defined(__cpp_lib_filesystem)
|
||||
#define JSON_HAS_FILESYSTEM 1
|
||||
#elif defined(__cpp_lib_experimental_filesystem)
|
||||
@ -66,6 +67,15 @@ using ordered_json = nlohmann::ordered_json;
|
||||
#undef JSON_HAS_FILESYSTEM
|
||||
#undef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
#define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0
|
||||
#endif
|
||||
|
||||
#ifndef JSON_HAS_FILESYSTEM
|
||||
#define JSON_HAS_FILESYSTEM 0
|
||||
#endif
|
||||
|
||||
#if JSON_HAS_EXPERIMENTAL_FILESYSTEM
|
||||
|
||||
Loading…
Reference in New Issue
Block a user