aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-04-06 23:06:37 +0200
committerAndreas Schneider <mail@cynapses.org>2010-05-10 10:41:47 +0200
commit9278dc0666de70f11b459e5b80e0c2ab6bbbe54c (patch)
treeba4335c0a1fc38d203d30019e6b52cd6010dd30d /include
parentaf519d73ae175e6564de2ccca4180f3e19996e96 (diff)
downloadlibssh-9278dc0666de70f11b459e5b80e0c2ab6bbbe54c.tar.gz
libssh-9278dc0666de70f11b459e5b80e0c2ab6bbbe54c.tar.xz
libssh-9278dc0666de70f11b459e5b80e0c2ab6bbbe54c.zip
Added more defines to use secure VC functions.
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 47039149..a3342816 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -33,13 +33,22 @@
#include "config.h"
#ifdef _MSC_VER
-#define snprintf _snprintf
+#undef snprintf
+#undef strtok_r
+
/** Imitate define of inttypes.h */
#define PRIdS "Id"
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#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)
+#define vsnprintf(s, n, f, v) _vsnprintf_s((s), (n), _TRUNCATE, (f), (v))
#else
#include <unistd.h>
#define PRIdS "zd"