mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
Use configure checks to define vsnprintf and strncpy.
This commit is contained in:
@@ -52,11 +52,19 @@
|
|||||||
#undef snprintf
|
#undef snprintf
|
||||||
#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
|
#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
|
||||||
|
|
||||||
#if _MSC_VER < 1500
|
#ifndef HAVE_VSNPRINTF
|
||||||
|
#ifdef HAVE__VSNPRINTF_S
|
||||||
#define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
|
#define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
|
||||||
|
#elif HAVE__VSNPRINTF
|
||||||
|
#define vsnprintf _vsnprintf
|
||||||
|
#else /* HAVE_VSNPRINTF */
|
||||||
|
#error "No vsnprintf compatibel function found"
|
||||||
|
#endif
|
||||||
|
#endif /* HAVE_VSNPRINTF */
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCPY
|
||||||
#define strncpy(d, s, n) strncpy_s((d), (n), (s), _TRUNCATE)
|
#define strncpy(d, s, n) strncpy_s((d), (n), (s), _TRUNCATE)
|
||||||
#endif /* _MSC_VER < 1500 */
|
#endif
|
||||||
#else /* _MSC_VER */
|
#else /* _MSC_VER */
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user