Fixed building libssh with MSVC.

Thanks to Carlo Segato for the patch.
This commit is contained in:
Andreas Schneider
2009-09-21 12:23:15 +02:00
parent 041aff8060
commit 4133f484ae
5 changed files with 19 additions and 8 deletions

View File

@@ -54,6 +54,7 @@
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef unsigned long long uint64_t;
typedef uint32_t mode_t;
#else /* _MSC_VER */
#include <unistd.h>
#include <inttypes.h>

View File

@@ -34,6 +34,10 @@
#define snprintf _snprintf
/** 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')
#else
#include <unistd.h>
#define PRIdS "zd"

View File

@@ -61,9 +61,6 @@ extern "C" {
typedef uint32_t gid_t;
#endif /* gid_t */
#ifdef _MSC_VER
#ifndef mode_t
typedef uint32_t mode_t;
#endif /* mode_t */
#ifndef ssize_t
typedef _W64 signed int ssize_t;
#endif /* ssize_t */