mirror of
https://github.com/isar/libmdbx.git
synced 2025-12-19 06:02:21 +08:00
mdbx-windows: ликвидация макроса OSAL_MB2WIDE().
This commit is contained in:
32
src/core.c
32
src/core.c
@@ -14487,9 +14487,11 @@ __cold int mdbx_env_open_for_recovery(MDBX_env *env, const char *pathname,
|
||||
unsigned target_meta, bool writeable) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
wchar_t *pathnameW = nullptr;
|
||||
OSAL_MB2WIDE(pathname, pathnameW);
|
||||
int rc = mdbx_env_open_for_recoveryW(env, pathnameW, target_meta, writeable);
|
||||
osal_free(pathnameW);
|
||||
int rc = osal_mb2w(pathname, &pathnameW);
|
||||
if (likely(rc == MDBX_SUCCESS)) {
|
||||
rc = mdbx_env_open_for_recoveryW(env, pathnameW, target_meta, writeable);
|
||||
osal_free(pathnameW);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -14678,9 +14680,11 @@ __cold static int handle_env_pathname(MDBX_handle_env_pathname *ctx,
|
||||
__cold int mdbx_env_delete(const char *pathname, MDBX_env_delete_mode_t mode) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
wchar_t *pathnameW = nullptr;
|
||||
OSAL_MB2WIDE(pathname, pathnameW);
|
||||
int rc = mdbx_env_deleteW(pathnameW, mode);
|
||||
osal_free(pathnameW);
|
||||
int rc = osal_mb2w(pathname, &pathnameW);
|
||||
if (likely(rc == MDBX_SUCCESS)) {
|
||||
rc = mdbx_env_deleteW(pathnameW, mode);
|
||||
osal_free(pathnameW);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -14771,9 +14775,11 @@ __cold int mdbx_env_open(MDBX_env *env, const char *pathname,
|
||||
MDBX_env_flags_t flags, mdbx_mode_t mode) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
wchar_t *pathnameW = nullptr;
|
||||
OSAL_MB2WIDE(pathname, pathnameW);
|
||||
int rc = mdbx_env_openW(env, pathnameW, flags, mode);
|
||||
osal_free(pathnameW);
|
||||
int rc = osal_mb2w(pathname, &pathnameW);
|
||||
if (likely(rc == MDBX_SUCCESS)) {
|
||||
rc = mdbx_env_openW(env, pathnameW, flags, mode);
|
||||
osal_free(pathnameW);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -21779,9 +21785,11 @@ __cold int mdbx_env_copy(MDBX_env *env, const char *dest_path,
|
||||
MDBX_copy_flags_t flags) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
wchar_t *dest_pathW = nullptr;
|
||||
OSAL_MB2WIDE(dest_path, dest_pathW);
|
||||
int rc = mdbx_env_copyW(env, dest_pathW, flags);
|
||||
osal_free(dest_pathW);
|
||||
int rc = osal_mb2w(dest_path, &dest_pathW);
|
||||
if (likely(rc == MDBX_SUCCESS)) {
|
||||
rc = mdbx_env_copyW(env, dest_pathW, flags);
|
||||
osal_free(dest_pathW);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user