diff --git a/test/base.h b/test/base.h index e882c191..ffcf61ad 100644 --- a/test/base.h +++ b/test/base.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2017 Leonid Yuriev * 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