From c2703065800c24cc8ba31081dcf090f9d54c8d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Tue, 8 Nov 2022 19:44:42 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-windows:=20=D1=83=D1=82=D0=BE=D1=87=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=BC=D0=B0=D0=BA=D1=80=D0=BE=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=20MinGW=20=D0=B8=20=D1=83=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B4=D1=83=D0=BF=D1=80?= =?UTF-8?q?=D0=B5=D0=B6=D0=B4=D0=B5=D0=BD=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/example-mdbx.c | 6 ++++++ src/base.h | 4 ---- src/core.c | 2 ++ src/internals.h | 2 +- src/mdbx.c++ | 2 +- test/osal-windows.c++ | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/example/example-mdbx.c b/example/example-mdbx.c index 501c430d..a3735f9a 100644 --- a/example/example-mdbx.c +++ b/example/example-mdbx.c @@ -18,7 +18,13 @@ * . */ +#if (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && \ + !defined(__USE_MINGW_ANSI_STDIO) +#define __USE_MINGW_ANSI_STDIO 1 +#endif /* MinGW */ + #include "mdbx.h" + #include #include #include diff --git a/src/base.h b/src/base.h index 187b5270..3533d575 100644 --- a/src/base.h +++ b/src/base.h @@ -236,10 +236,6 @@ __extern_C key_t ftok(const char *, int); #elif _WIN32_WINNT < 0x0500 #error At least 'Windows 2000' API is required for libmdbx. #endif /* _WIN32_WINNT */ -#if (defined(__MINGW32__) || defined(__MINGW64__)) && \ - !defined(__USE_MINGW_ANSI_STDIO) -#define __USE_MINGW_ANSI_STDIO 1 -#endif /* MinGW */ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif /* WIN32_LEAN_AND_MEAN */ diff --git a/src/core.c b/src/core.c index fb30b30e..40ed3bd1 100644 --- a/src/core.c +++ b/src/core.c @@ -24419,6 +24419,8 @@ __dll_export "MINGW-64 " MDBX_STRINGIFY(__MINGW64_MAJOR_VERSION) "." MDBX_STRINGIFY(__MINGW64_MINOR_VERSION) #elif defined(__MINGW32__) "MINGW-32 " MDBX_STRINGIFY(__MINGW32_MAJOR_VERSION) "." MDBX_STRINGIFY(__MINGW32_MINOR_VERSION) + #elif defined(__MINGW__) + "MINGW " MDBX_STRINGIFY(__MINGW_MAJOR_VERSION) "." MDBX_STRINGIFY(__MINGW_MINOR_VERSION) #elif defined(__IBMC__) "IBM C " MDBX_STRINGIFY(__IBMC__) #elif defined(__GNUC__) diff --git a/src/internals.h b/src/internals.h index 55b17b3b..d29b1068 100644 --- a/src/internals.h +++ b/src/internals.h @@ -126,7 +126,7 @@ #if (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && \ !defined(__USE_MINGW_ANSI_STDIO) #define __USE_MINGW_ANSI_STDIO 1 -#endif /* __USE_MINGW_ANSI_STDIO */ +#endif /* MinGW */ #if (defined(_WIN32) || defined(_WIN64)) && !defined(UNICODE) #define UNICODE diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 78a4ead0..17716c4b 100644 --- a/src/mdbx.c++ +++ b/src/mdbx.c++ @@ -12,7 +12,7 @@ #if (defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) && \ !defined(__USE_MINGW_ANSI_STDIO) #define __USE_MINGW_ANSI_STDIO 1 -#endif /* __USE_MINGW_ANSI_STDIO */ +#endif /* MinGW */ #include "../mdbx.h++" diff --git a/test/osal-windows.c++ b/test/osal-windows.c++ index 711a9b12..f656d70a 100644 --- a/test/osal-windows.c++ +++ b/test/osal-windows.c++ @@ -363,11 +363,11 @@ actor_status osal_actor_info(const mdbx_pid_t pid) { case /* STATUS_ASSERTION_FAILURE */ 0xC0000420L: case /* STATUS_HEAP_CORRUPTION */ 0xC0000374L: case /* STATUS_CONTROL_STACK_VIOLATION */ 0xC00001B2L: - log_error("pid %u, exception 0x%x", pid, ExitCode); + log_error("pid %zu, exception 0x%x", (intptr_t)pid, (unsigned)ExitCode); status = as_coredump; break; default: - log_error("pid %u, exit code %u", pid, ExitCode); + log_error("pid %zu, exit code %u", (intptr_t)pid, (unsigned)ExitCode); status = as_failed; break; }