mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:44:13 +08:00
mdbx-windows: use _snprintf() and _vsnprintf() to avoid dependency from CRT.
8 of 17 for https://github.com/leo-yuriev/libmdbx/issues/43 Change-Id: I335a12344b0f0d63462ac4195fafdb60f981f182
This commit is contained in:
parent
ded5269937
commit
4dea5c2719
16
src/osal.h
16
src/osal.h
@ -94,6 +94,8 @@ static inline void *mdbx_realloc(void *ptr, size_t bytes) {
|
|||||||
return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
|
return LocalReAlloc(ptr, bytes, LMEM_MOVEABLE);
|
||||||
}
|
}
|
||||||
#define mdbx_free LocalFree
|
#define mdbx_free LocalFree
|
||||||
|
#define snprintf _snprintf /* ntdll */
|
||||||
|
#define vsnprintf _vsnprintf /* ntdll */
|
||||||
#else
|
#else
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -401,20 +403,6 @@ __printf_args(2, 3) int mdbx_asprintf(char **strp, const char *fmt, ...);
|
|||||||
int mdbx_vasprintf(char **strp, const char *fmt, va_list ap);
|
int mdbx_vasprintf(char **strp, const char *fmt, va_list ap);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
#ifndef snprintf
|
|
||||||
#define snprintf(buffer, buffer_size, format, ...) \
|
|
||||||
_snprintf_s(buffer, buffer_size, _TRUNCATE, format, __VA_ARGS__)
|
|
||||||
#endif /* snprintf */
|
|
||||||
|
|
||||||
#ifndef vsnprintf
|
|
||||||
#define vsnprintf(buffer, buffer_size, format, args) \
|
|
||||||
_vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, args)
|
|
||||||
#endif /* vsnprintf */
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
/* OS abstraction layer stuff */
|
/* OS abstraction layer stuff */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user