From 0ffd3fdae93828b128f3e3b0214ac520d52aaa21 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 19 May 2017 09:18:09 +0200 Subject: [PATCH] Add stddef.h for POSIX ssize_t Recent GCC versions / OS headers don't automatically provide ssize_t anymore, leading to compiler errors. --- lib/capnp_c.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/capnp_c.h b/lib/capnp_c.h index deb550c..ffd3a6a 100644 --- a/lib/capnp_c.h +++ b/lib/capnp_c.h @@ -19,9 +19,13 @@ #include #endif -// ssize_t is not defined in stdint.h in MSVC. +/* ssize_t is a POSIX type, not an ISO C one... + * Windows seems to only have SSIZE_T in BaseTsd.h + */ #ifdef _MSC_VER typedef intmax_t ssize_t; +#else +#include #endif // Cross-platform macro ALIGNED_(x) aligns a struct by `x` bytes.