mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-06-02 03:41:34 +03:00
Added more defines to use secure VC functions.
This commit is contained in:
parent
af519d73ae
commit
9278dc0666
@ -33,13 +33,22 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define snprintf _snprintf
|
#undef snprintf
|
||||||
|
#undef strtok_r
|
||||||
|
|
||||||
/** Imitate define of inttypes.h */
|
/** Imitate define of inttypes.h */
|
||||||
#define PRIdS "Id"
|
#define PRIdS "Id"
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define strtoull _strtoui64
|
#define strtoull _strtoui64
|
||||||
#define isblank(ch) ((ch) == ' ' || (ch) == '\t' || (ch) == '\n' || (ch) == '\r')
|
#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
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#define PRIdS "zd"
|
#define PRIdS "zd"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user