mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-30 22:47:16 +08:00
mdbx: resolve all warnings from MinGW.
This commit is contained in:
parent
21da42d23d
commit
6f37c8e57f
11
mdbx.h
11
mdbx.h
@ -324,7 +324,8 @@ typedef mode_t mdbx_mode_t;
|
|||||||
#endif /* MDBX_DEPRECATED */
|
#endif /* MDBX_DEPRECATED */
|
||||||
|
|
||||||
#ifndef __dll_export
|
#ifndef __dll_export
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
|
||||||
|
defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
#if defined(__GNUC__) || __has_attribute(__dllexport__)
|
#if defined(__GNUC__) || __has_attribute(__dllexport__)
|
||||||
#define __dll_export __attribute__((__dllexport__))
|
#define __dll_export __attribute__((__dllexport__))
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
@ -340,7 +341,8 @@ typedef mode_t mdbx_mode_t;
|
|||||||
#endif /* __dll_export */
|
#endif /* __dll_export */
|
||||||
|
|
||||||
#ifndef __dll_import
|
#ifndef __dll_import
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || \
|
||||||
|
defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
#if defined(__GNUC__) || __has_attribute(__dllimport__)
|
#if defined(__GNUC__) || __has_attribute(__dllimport__)
|
||||||
#define __dll_import __attribute__((__dllimport__))
|
#define __dll_import __attribute__((__dllimport__))
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
@ -457,8 +459,13 @@ typedef mode_t mdbx_mode_t;
|
|||||||
|
|
||||||
#ifndef MDBX_PRINTF_ARGS
|
#ifndef MDBX_PRINTF_ARGS
|
||||||
#if defined(__GNUC__) || __has_attribute(__format__)
|
#if defined(__GNUC__) || __has_attribute(__format__)
|
||||||
|
#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
#define MDBX_PRINTF_ARGS(format_index, first_arg) \
|
||||||
|
__attribute__((__format__(__gnu_printf__, format_index, first_arg)))
|
||||||
|
#else
|
||||||
#define MDBX_PRINTF_ARGS(format_index, first_arg) \
|
#define MDBX_PRINTF_ARGS(format_index, first_arg) \
|
||||||
__attribute__((__format__(__printf__, format_index, first_arg)))
|
__attribute__((__format__(__printf__, format_index, first_arg)))
|
||||||
|
#endif /* __MINGW_PRINTF_FORMAT */
|
||||||
#else
|
#else
|
||||||
#define MDBX_PRINTF_ARGS(format_index, first_arg)
|
#define MDBX_PRINTF_ARGS(format_index, first_arg)
|
||||||
#endif
|
#endif
|
||||||
|
1
mdbx.h++
1
mdbx.h++
@ -5463,6 +5463,7 @@ inline size_t txn::put_multiple(map_handle map, const slice &key,
|
|||||||
if (allow_partial)
|
if (allow_partial)
|
||||||
break;
|
break;
|
||||||
mdbx_txn_break(handle_);
|
mdbx_txn_break(handle_);
|
||||||
|
MDBX_CXX17_FALLTHROUGH /* fallthrough */;
|
||||||
default:
|
default:
|
||||||
MDBX_CXX20_UNLIKELY error::throw_exception(err);
|
MDBX_CXX20_UNLIKELY error::throw_exception(err);
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,11 @@
|
|||||||
# define __noop(...) do {} while(0)
|
# define __noop(...) do {} while(0)
|
||||||
#endif /* __noop */
|
#endif /* __noop */
|
||||||
|
|
||||||
|
#if defined(__fallthrough) && \
|
||||||
|
(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__))
|
||||||
|
#undef __fallthrough
|
||||||
|
#endif /* __fallthrough workaround for MinGW */
|
||||||
|
|
||||||
#ifndef __fallthrough
|
#ifndef __fallthrough
|
||||||
# if defined(__cplusplus) && (__has_cpp_attribute(fallthrough) && \
|
# if defined(__cplusplus) && (__has_cpp_attribute(fallthrough) && \
|
||||||
(!defined(__clang__) || __clang__ > 4)) || __cplusplus >= 201703L
|
(!defined(__clang__) || __clang__ > 4)) || __cplusplus >= 201703L
|
||||||
|
@ -122,6 +122,11 @@
|
|||||||
#pragma GCC diagnostic ignored "-Wattributes"
|
#pragma GCC diagnostic ignored "-Wattributes"
|
||||||
#endif /* GCC < 9 */
|
#endif /* GCC < 9 */
|
||||||
|
|
||||||
|
#if (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && \
|
||||||
|
!defined(__USE_MINGW_ANSI_STDIO)
|
||||||
|
#define __USE_MINGW_ANSI_STDIO 1
|
||||||
|
#endif /* __USE_MINGW_ANSI_STDIO */
|
||||||
|
|
||||||
#include "../mdbx.h"
|
#include "../mdbx.h"
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
@ -754,6 +754,11 @@ MDBX_GetTickCount64 mdbx_GetTickCount64;
|
|||||||
MDBX_RegGetValueA mdbx_RegGetValueA;
|
MDBX_RegGetValueA mdbx_RegGetValueA;
|
||||||
#endif /* xMDBX_ALLOY */
|
#endif /* xMDBX_ALLOY */
|
||||||
|
|
||||||
|
#if __GNUC_PREREQ(8, 0)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||||
|
#endif /* GCC/MINGW */
|
||||||
|
|
||||||
static void mdbx_winnt_import(void) {
|
static void mdbx_winnt_import(void) {
|
||||||
const HINSTANCE hNtdll = GetModuleHandleA("ntdll.dll");
|
const HINSTANCE hNtdll = GetModuleHandleA("ntdll.dll");
|
||||||
|
|
||||||
@ -805,4 +810,8 @@ static void mdbx_winnt_import(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __GNUC_PREREQ(8, 0)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif /* GCC/MINGW */
|
||||||
|
|
||||||
#endif /* Windows LCK-implementation */
|
#endif /* Windows LCK-implementation */
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#endif /* _CRT_SECURE_NO_WARNINGS */
|
#endif /* _CRT_SECURE_NO_WARNINGS */
|
||||||
|
|
||||||
|
#if (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && \
|
||||||
|
!defined(__USE_MINGW_ANSI_STDIO)
|
||||||
|
#define __USE_MINGW_ANSI_STDIO 1
|
||||||
|
#endif /* __USE_MINGW_ANSI_STDIO */
|
||||||
|
|
||||||
#include "../mdbx.h++"
|
#include "../mdbx.h++"
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
@ -474,7 +474,7 @@ typedef union bin128 {
|
|||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
typedef union MDBX_srwlock {
|
typedef union MDBX_srwlock {
|
||||||
struct {
|
__anonymous_struct_extension__ struct {
|
||||||
long volatile readerCount;
|
long volatile readerCount;
|
||||||
long volatile writerCount;
|
long volatile writerCount;
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,12 @@ time from_ms(uint64_t ms) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __GNUC_PREREQ(8, 0) && \
|
||||||
|
(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__))
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||||
|
#endif /* GCC/MINGW */
|
||||||
|
|
||||||
time now_realtime() {
|
time now_realtime() {
|
||||||
#if defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS)
|
#if defined(_WIN32) || defined(_WIN64) || defined(_WINDOWS)
|
||||||
static void(WINAPI * query_time)(LPFILETIME);
|
static void(WINAPI * query_time)(LPFILETIME);
|
||||||
@ -133,4 +139,9 @@ time now_monotonic() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __GNUC_PREREQ(8, 0) && \
|
||||||
|
(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__))
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif /* GCC/MINGW */
|
||||||
|
|
||||||
} /* namespace chrono */
|
} /* namespace chrono */
|
||||||
|
@ -75,7 +75,7 @@ void osal_setup(const std::vector<actor_config> &actors) {
|
|||||||
if (!hEvent)
|
if (!hEvent)
|
||||||
failure_perror("CreateEvent()", GetLastError());
|
failure_perror("CreateEvent()", GetLastError());
|
||||||
hEvent = make_inheritable(hEvent);
|
hEvent = make_inheritable(hEvent);
|
||||||
log_trace("osal_setup: event %" PRIuPTR " -> %p", i, hEvent);
|
log_trace("osal_setup: event %u -> %p", i, hEvent);
|
||||||
events[i] = hEvent;
|
events[i] = hEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user