aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-05-10 15:32:17 +0200
committerAndreas Schneider <mail@cynapses.org>2010-05-10 15:32:17 +0200
commit8ba02b6f4c5d62ef8eac689c71ecb3c5f33852a1 (patch)
treeda033b73d4d8617ae564bd190e0e8ddd06597e25 /include
parentf5191ec222b1d41a2fa80f9f8a4b7d8737b4d173 (diff)
downloadlibssh-8ba02b6f4c5d62ef8eac689c71ecb3c5f33852a1.tar.gz
libssh-8ba02b6f4c5d62ef8eac689c71ecb3c5f33852a1.tar.xz
libssh-8ba02b6f4c5d62ef8eac689c71ecb3c5f33852a1.zip
Use configure checks to define vsnprintf and strncpy.
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 318680a4..d53b6429 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -52,11 +52,19 @@
#undef snprintf
#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))
+#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)
-#endif /* _MSC_VER < 1500 */
+#endif
#else /* _MSC_VER */
#include <unistd.h>