From ad4549295d8eb1be238d36c008acbd28f6203eef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Oct 2018 14:07:48 +0300 Subject: mdbx_dump & mdbx_load utilities adapted for Miranda --- libs/libmdbx/src/src/osal.h | 4 ++-- libs/libmdbx/src/src/tools/wingetopt.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libs') diff --git a/libs/libmdbx/src/src/osal.h b/libs/libmdbx/src/src/osal.h index a1feb998d2..065128103e 100644 --- a/libs/libmdbx/src/src/osal.h +++ b/libs/libmdbx/src/src/osal.h @@ -652,7 +652,7 @@ static __inline uint32_t mdbx_atomic_add32(volatile uint32_t *p, uint32_t v) { return __sync_fetch_and_add(p, v); #else #ifdef _MSC_VER - return _InterlockedExchangeAdd(p, v); + return _InterlockedExchangeAdd((volatile long *)p, v); #endif #ifdef __APPLE__ return OSAtomicAdd32(v, (volatile int32_t *)p); @@ -692,7 +692,7 @@ static __inline bool mdbx_atomic_compare_and_swap32(volatile uint32_t *p, return __sync_bool_compare_and_swap(p, c, v); #else #ifdef _MSC_VER - return c == _InterlockedCompareExchange(p, v, c); + return c == _InterlockedCompareExchange((volatile long*)p, v, c); #endif #ifdef __APPLE__ return c == OSAtomicCompareAndSwap32Barrier(c, v, (volatile int32_t *)p); diff --git a/libs/libmdbx/src/src/tools/wingetopt.c b/libs/libmdbx/src/src/tools/wingetopt.c index 1dd0d069fb..6ed6dc3cc8 100644 --- a/libs/libmdbx/src/src/tools/wingetopt.c +++ b/libs/libmdbx/src/src/tools/wingetopt.c @@ -66,7 +66,7 @@ int getopt(int argc, char *const argv[], const char *opts) { } } optopt = c = argv[optind][sp]; - if (c == ':' || (cp = strchr(opts, c)) == NULL) { + if (c == ':' || (cp = (char *)strchr(opts, c)) == NULL) { ERR(": illegal option -- ", c); if (argv[optind][++sp] == '\0') { optind++; -- cgit v1.2.3