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; }