Add stddef.h for POSIX ssize_t

Recent GCC versions / OS headers don't automatically provide ssize_t
anymore, leading to compiler errors.
This commit is contained in:
David Lamparter 2017-05-19 09:18:09 +02:00
parent 2330c177d3
commit 0ffd3fdae9

View file

@ -19,9 +19,13 @@
#include <endian.h> #include <endian.h>
#endif #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 #ifdef _MSC_VER
typedef intmax_t ssize_t; typedef intmax_t ssize_t;
#else
#include <stddef.h>
#endif #endif
// Cross-platform macro ALIGNED_(x) aligns a struct by `x` bytes. // Cross-platform macro ALIGNED_(x) aligns a struct by `x` bytes.