aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-05-10 14:40:00 +0200
committerAndreas Schneider <mail@cynapses.org>2010-05-10 14:40:00 +0200
commit8dcfc9849e94f15b42118e0929b6667028291138 (patch)
treeb13735812e7a9efccace03105dc311913ea44782 /include/libssh
parentb28fb6654ce8401aad26e0ae73f49f5fb937786f (diff)
downloadlibssh-8dcfc9849e94f15b42118e0929b6667028291138.tar.gz
libssh-8dcfc9849e94f15b42118e0929b6667028291138.tar.xz
libssh-8dcfc9849e94f15b42118e0929b6667028291138.zip
Fixed building libssh with VC9.
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/priv.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 29795c3..318680a 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -33,9 +33,8 @@
#include "config.h"
#ifdef _MSC_VER
-#undef snprintf
-#undef vsnprintf
-#undef strtok_r
+
+#include <varargs.h>
/** Imitate define of inttypes.h */
#define PRIdS "Id"
@@ -44,16 +43,26 @@
#define strtoull _strtoui64
#define isblank(ch) ((ch) == ' ' || (ch) == '\t' || (ch) == '\n' || (ch) == '\r')
-#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
#define strdup _strdup
-#define strncpy(d, s, n) strncpy_s((d), (n), (s), _TRUNCATE)
-#define strtok_r strtok_s
#define usleep(X) Sleep(((X)+1000)/1000)
+
+#undef strtok_r
+#define strtok_r strtok_s
+
+#undef snprintf
+#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
+
+#if _MSC_VER < 1500
#define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
-#else
+
+#define strncpy(d, s, n) strncpy_s((d), (n), (s), _TRUNCATE)
+#endif /* _MSC_VER < 1500 */
+#else /* _MSC_VER */
+
#include <unistd.h>
#define PRIdS "zd"
-#endif
+
+#endif /* _MSC_VER */
#include "libssh/libssh.h"
#include "libssh/callbacks.h"