From f0383d50cde1d17e75602a04d6a86fc82bd1ceb9 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 30 May 2022 14:47:44 +0200 Subject: [PATCH] Include unistd.h for ssize_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling on buildroot I get: `src/tls.c:235:28: error: ‘ssize_t’ undeclared (first use in this function); did you mean ‘size_t’? ` To have this POSIX type available we will need to include `sys/types.h` or `unistd.h`. --- src/rand.c | 4 ++++ src/tls.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/rand.c b/src/rand.c index 061e85e..c696944 100644 --- a/src/rand.c +++ b/src/rand.c @@ -23,6 +23,10 @@ #include /* memeset */ #include /* clock, time */ +#if !defined(_WIN32) +#include +#endif + #if !defined(DONT_USE_GETRANDOM) && defined(__linux__) && \ defined(__GLIBC_PREREQ) #if __GLIBC_PREREQ(2, 25) diff --git a/src/tls.c b/src/tls.c index 17d85dd..a6e75a5 100644 --- a/src/tls.c +++ b/src/tls.c @@ -21,6 +21,10 @@ #include #include +#if !defined(_WIN32) +#include +#endif + #include "strophe.h" #include "common.h"