🔨 trying code from https://godbolt.org/z/-tLO1K
This commit is contained in:
parent
d359fd3a8d
commit
e36593e960
2 changed files with 16 additions and 8 deletions
|
@ -38,13 +38,17 @@
|
|||
#endif
|
||||
|
||||
// allow for portable nodiscard warnings
|
||||
#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
|
||||
#if defined(__has_cpp_attribute)
|
||||
#if __has_cpp_attribute(nodiscard)
|
||||
#define JSON_NODISCARD [[nodiscard]]
|
||||
#elif defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::warn_unused_result)
|
||||
#elif __has_cpp_attribute(gnu::warn_unused_result)
|
||||
#define JSON_NODISCARD [[gnu::warn_unused_result]]
|
||||
#else
|
||||
#define JSON_NODISCARD
|
||||
#endif
|
||||
#else
|
||||
#define JSON_NODISCARD
|
||||
#endif
|
||||
|
||||
// allow to disable exceptions
|
||||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
|
||||
|
|
|
@ -153,13 +153,17 @@ using json = basic_json<>;
|
|||
#endif
|
||||
|
||||
// allow for portable nodiscard warnings
|
||||
#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
|
||||
#if defined(__has_cpp_attribute)
|
||||
#if __has_cpp_attribute(nodiscard)
|
||||
#define JSON_NODISCARD [[nodiscard]]
|
||||
#elif defined(__has_cpp_attribute) && __has_cpp_attribute(gnu::warn_unused_result)
|
||||
#elif __has_cpp_attribute(gnu::warn_unused_result)
|
||||
#define JSON_NODISCARD [[gnu::warn_unused_result]]
|
||||
#else
|
||||
#define JSON_NODISCARD
|
||||
#endif
|
||||
#else
|
||||
#define JSON_NODISCARD
|
||||
#endif
|
||||
|
||||
// allow to disable exceptions
|
||||
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
|
||||
|
|
Loading…
Reference in a new issue