Use local type declaration for POSIX standard type only for MS compiler

ssize_t is a POSIX type which is declared in POSIX include files.
Mingw-w64 provides it also for Windows.

Use the local declaration only with MS compilers.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-18 14:06:25 +02:00
parent fd205f457b
commit 4aaf52ec8d
1 changed files with 2 additions and 0 deletions

View File

@ -30,7 +30,9 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#ifdef _MSC_VER
typedef SSIZE_T ssize_t; typedef SSIZE_T ssize_t;
#endif
#else #else
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>