mdbx-test: fix snprintf/vsnprintf redefinition for MSVC.

Change-Id: I4be3a4f71782d395035ff4d5b9e3a1af9ee70bb9
This commit is contained in:
Leo Yuriev 2017-07-26 19:43:22 +03:00
parent 092156ee4f
commit d634336e1f

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright 2017 Leonid Yuriev <leo@yuriev.ru>
* and other libmdbx authors: please see AUTHORS file.
* All rights reserved.
@ -99,7 +99,14 @@
#pragma warning(disable : 4512) /* assignment operator could \
not be generated */
#pragma warning(disable : 4610) /* user-defined constructor required */
#define snprintf _snprintf
#ifndef snprintf
#define snprintf(buffer, buffer_size, format, ...) \
_snprintf_s(buffer, buffer_size, _TRUNCATE, format, __VA_ARGS__)
#endif
#ifndef vsnprintf
#define vsnprintf(buffer, buffer_size, format, args) \
_vsnprintf_s(buffer, buffer_size, _TRUNCATE, format, args)
#endif
#pragma warning(disable : 4996) /* 'vsnprintf': This function or variable \
may be unsafe */
#endif