Skip to content

Commit

Permalink
mdbx fix assert (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Apr 12, 2022
1 parent b43356c commit afcb6f1
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions mdbx/mdbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit afcb6f1

Please sign in to comment.