mdbx: resolve all warnings from MinGW.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2022-03-30 18:13:08 +03:00
parent 21da42d23d
commit 6f37c8e57f
9 changed files with 47 additions and 4 deletions

View File

@@ -107,6 +107,11 @@
# define __noop(...) do {} while(0)
#endif /* __noop */
#if defined(__fallthrough) && \
(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__))
#undef __fallthrough
#endif /* __fallthrough workaround for MinGW */
#ifndef __fallthrough
# if defined(__cplusplus) && (__has_cpp_attribute(fallthrough) && \
(!defined(__clang__) || __clang__ > 4)) || __cplusplus >= 201703L

View File

@@ -122,6 +122,11 @@
#pragma GCC diagnostic ignored "-Wattributes"
#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 "defs.h"

View File

@@ -754,6 +754,11 @@ MDBX_GetTickCount64 mdbx_GetTickCount64;
MDBX_RegGetValueA mdbx_RegGetValueA;
#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) {
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 */

View File

@@ -9,6 +9,11 @@
#define _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 "defs.h"

View File

@@ -474,7 +474,7 @@ typedef union bin128 {
#if defined(_WIN32) || defined(_WIN64)
typedef union MDBX_srwlock {
struct {
__anonymous_struct_extension__ struct {
long volatile readerCount;
long volatile writerCount;
};