Define ssize_t for MSVC

ssize_t is not available in visual studio, nor is sys/param.h We typedef
intmax_t to ssize_t
This commit is contained in:
Nathanael Jones 2016-05-11 09:57:41 -07:00
parent a15accf4eb
commit 8d0ccbeeae
2 changed files with 7 additions and 0 deletions

View file

@ -11,7 +11,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef _MSC_VER
#include <sys/param.h> #include <sys/param.h>
#endif
#define STRUCT_PTR 0 #define STRUCT_PTR 0
#define LIST_PTR 1 #define LIST_PTR 1

View file

@ -14,6 +14,11 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
// ssize_t is not defined in stdint.h in MSVC.
#ifdef _MSC_VER
typedef intmax_t ssize_t;
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif