Commit 3735b73d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠 Committed by Olivier Crête

windows: use proper fallback for ssize_t and use stdint.h for types

stdint.h is available since vs2010 and stdbool.h since vs2013,
so we should be able to just use that these days.
parent e4614618
......@@ -58,25 +58,14 @@
#define _WIN32_COMMON_H
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
/* Exact-width integer types */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
/* ssize_t is not defined on Windows */
#ifndef ssize_t
# if defined(_WIN64)
typedef signed __int64 ssize_t;
# else
typedef signed long ssize_t;
# endif
#endif /* !ssize_t */
/* On MSVC, ssize_t is SSIZE_T */
#ifdef _MSC_VER
#include <BaseTsd.h>
#define ssize_t SSIZE_T
/* Windows v10.0.16232 SDK defines MSG_ERRQUEUE, but doesn't support it with
* recvmsg, and also uses a different msghdr struct */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment