diff --git a/mdbx/mdbx.h b/mdbx/mdbx.h index 1e71f1a..2ca9a4e 100644 --- a/mdbx/mdbx.h +++ b/mdbx/mdbx.h @@ -324,7 +324,8 @@ typedef mode_t mdbx_mode_t; #endif /* MDBX_DEPRECATED */ #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__) #define __dll_export __attribute__((__dllexport__)) #elif defined(_MSC_VER) @@ -340,7 +341,8 @@ typedef mode_t mdbx_mode_t; #endif /* __dll_export */ #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__) #define __dll_import __attribute__((__dllimport__)) #elif defined(_MSC_VER) @@ -457,8 +459,13 @@ typedef mode_t mdbx_mode_t; #ifndef MDBX_PRINTF_ARGS #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) \ __attribute__((__format__(__printf__, format_index, first_arg))) +#endif /* MinGW */ #else #define MDBX_PRINTF_ARGS(format_index, first_arg) #endif @@ -2880,10 +2887,15 @@ LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd); * some possible errors are: * \retval MDBX_EINVAL An invalid parameter was specified, * or the environment has an active write transaction. - * \retval MDBX_EPERM Specific for Windows: Shrinking was disabled before - * and now it wanna be enabled, but there are reading - * threads that don't use the additional `SRWL` (that - * is required to avoid Windows issues). + * \retval MDBX_EPERM Two specific cases for Windows: + * 1) Shrinking was disabled before via geometry settings + * and now it enabled, but there are reading threads that + * don't use the additional `SRWL` (which is required to + * avoid Windows issues). + * 2) Temporary close memory mapped is required to change + * geometry, but there read transaction(s) is running + * and no corresponding thread(s) could be suspended + * since the \ref MDBX_NOTLS mode is used. * \retval MDBX_EACCESS The environment opened in read-only. * \retval MDBX_MAP_FULL Specified size smaller than the space already * consumed by the environment.