mdbx: refine/fix MDBX_MAYBE_UNUSED for modern GCC 11.x and C20.

This commit is contained in:
Leonid Yuriev 2021-05-12 12:22:42 +03:00
parent 76b9cb5dcc
commit 23e11e3a57

3
mdbx.h
View File

@ -454,7 +454,8 @@ typedef mode_t mdbx_mode_t;
#endif
#endif /* MDBX_PRINTF_ARGS */
#if defined(DOXYGEN) || __has_cpp_attribute(maybe_unused)
#if defined(DOXYGEN) || (__has_cpp_attribute(maybe_unused) && \
(defined(__cplusplus) || __STDC_VERSION__ > 202005L))
#define MDBX_MAYBE_UNUSED [[maybe_unused]]
#elif defined(__GNUC__) || __has_attribute(__unused__)
#define MDBX_MAYBE_UNUSED __attribute__((__unused__))