mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-25 21:54:28 +08:00
mdbx-windows: add mdbx_strdup() to avoid dependency from CRT.
12 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43 Change-Id: Ib1379d75dc25e34f56daf8988848c41f59b6cd6b
This commit is contained in:
@@ -119,6 +119,7 @@ typedef pthread_mutex_t mdbx_fastmutex_t;
|
||||
#define mdbx_calloc calloc
|
||||
#define mdbx_realloc realloc
|
||||
#define mdbx_free free
|
||||
#define mdbx_strdup strdup
|
||||
#endif /* Platform */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
@@ -422,13 +423,9 @@ static __inline size_t mdbx_syspagesize(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline char *mdbx_strdup(const char *str) {
|
||||
#ifdef _MSC_VER
|
||||
return _strdup(str);
|
||||
#else
|
||||
return strdup(str);
|
||||
#ifndef mdbx_strdup
|
||||
char *mdbx_strdup(const char *str);
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline int mdbx_get_errno(void) {
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
Reference in New Issue
Block a user