From 3735b73d54f05facd36e49f3b5ee7c6fa82de9cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 14 Dec 2018 17:09:58 +0000 Subject: [PATCH] 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. --- stun/win32_common.h | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/stun/win32_common.h b/stun/win32_common.h index feddc30..ec833c3 100644 --- a/stun/win32_common.h +++ b/stun/win32_common.h @@ -58,25 +58,14 @@ #define _WIN32_COMMON_H #include +#include +#include -/* 7.18.1.1 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 +#define ssize_t SSIZE_T +#endif /* Windows v10.0.16232 SDK defines MSG_ERRQUEUE, but doesn't support it with * recvmsg, and also uses a different msghdr struct */ -- 2.7.4