From af1d01ffb3e35325d6ccb53977089211eebecf57 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=20(backport).?= 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.cc | 1 + 6 files changed, 11 insertions(+), 6 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 ec5321ff..57c0d311 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 153e06a7..fa07fb1b 100644 --- a/src/core.c +++ b/src/core.c @@ -23233,6 +23233,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 0f7b6e54..ea7f5fe7 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 */ #include "../mdbx.h" #include "base.h" diff --git a/src/mdbx.c++ b/src/mdbx.c++ index 2375a1b7..76d831b6 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.cc b/test/osal-windows.cc index 29ac5cb1..fc19315c 100644 --- a/test/osal-windows.cc +++ b/test/osal-windows.cc @@ -360,6 +360,7 @@ actor_status osal_actor_info(const mdbx_pid_t pid) { status = as_coredump; break; default: + log_error("pid %zu, exit code %u", (intptr_t)pid, (unsigned)ExitCode); status = as_failed; break; }