mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-19 19:39:26 +08:00
mdbx: add public MDBX_MAYBE_UNUSED
.
This also should fix C++ mdbx API build by MSVC 2015.
This commit is contained in:
@@ -45,11 +45,11 @@
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#include <atomic>
|
||||
static __inline __maybe_unused int atomic_decrement(std::atomic_int *p) {
|
||||
MDBX_MAYBE_UNUSED static __inline int atomic_decrement(std::atomic_int *p) {
|
||||
return std::atomic_fetch_sub(p, 1) - 1;
|
||||
}
|
||||
#else
|
||||
static __inline __maybe_unused int atomic_decrement(volatile int *p) {
|
||||
MDBX_MAYBE_UNUSED static __inline int atomic_decrement(volatile int *p) {
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
return __sync_sub_and_fetch(p, 1);
|
||||
#elif defined(_MSC_VER)
|
||||
|
Reference in New Issue
Block a user