🔨 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,10 +38,14 @@
|
|||
#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
|
||||
|
|
|
@ -153,10 +153,14 @@ 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
|
||||
|
|
Loading…
Reference in a new issue