From abc61fa1ccfa5472ab4dbc0088663f8b26582196 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Fri, 14 May 2010 12:46:17 +0200 Subject: Fix build on VC7 --- include/libssh/priv.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/libssh') diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 826e9692..77423bfb 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -50,8 +50,17 @@ #undef strtok_r #define strtok_r strtok_s -#undef snprintf +#ifndef HAVE_SNPRINTF +#ifdef HAVE__SNPRINTF_S #define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__) +#else +#ifdef HAVE__SNPRINTF +#define snprintf _snprintf +#else +#error "no snprintf compatible function found" +#endif /* HAVE__SNPRINTF */ +#endif /* HAVE__SNPRINTF_S */ +#endif /* HAVE_SNPRINTF */ #ifndef HAVE_VSNPRINTF #ifdef HAVE__VSNPRINTF_S @@ -59,7 +68,7 @@ #elif HAVE__VSNPRINTF #define vsnprintf _vsnprintf #else /* HAVE_VSNPRINTF */ -#error "No vsnprintf compatibel function found" +#error "No vsnprintf compatible function found" #endif #endif /* HAVE_VSNPRINTF */ -- cgit