From: Willy Tarreau Date: Mon, 26 Nov 2018 18:41:40 +0000 (+0100) Subject: BUILD: buffers: buf.h requires unistd to get ssize_t on libmusl X-Git-Tag: v1.9-dev9~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7280a1ec2ebb99f19ebf55f6875f04bc9a44085;p=thirdparty%2Fhaproxy.git BUILD: buffers: buf.h requires unistd to get ssize_t on libmusl Building with musl and gcc-5.3 for MIPS returns this : include/common/buf.h: In function 'b_dist': include/common/buf.h:252:2: error: unknown type name 'ssize_t' ssize_t dist = to - from; ^ Including stdint or stddef is not sufficient there to get ssize_t, unistd is needed as well. It's likely that other platforms will have the same issue. This patch also addresses it in ist.h and memory.h. --- diff --git a/include/common/buf.h b/include/common/buf.h index d39de7112a..cc670bf38c 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -30,6 +30,7 @@ #include #include +#include /* Structure defining a buffer's head */ struct buffer { diff --git a/include/common/ist.h b/include/common/ist.h index 7c60c68f3c..cfab1e32cc 100644 --- a/include/common/ist.h +++ b/include/common/ist.h @@ -30,6 +30,7 @@ #include #include +#include #include diff --git a/include/common/memory.h b/include/common/memory.h index b854ebb0b2..57d6ba63e6 100644 --- a/include/common/memory.h +++ b/include/common/memory.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/include/proto/htx.h b/include/proto/htx.h index dd525fed3e..779aab6d57 100644 --- a/include/proto/htx.h +++ b/include/proto/htx.h @@ -440,10 +440,10 @@ static inline void htx_dump(struct htx *htx) { int32_t pos; - fprintf(stderr, "htx:%p [ size=%u - data=%u - used=%u - wrap=%s - extra=%lu]\n", + fprintf(stderr, "htx:%p [ size=%u - data=%u - used=%u - wrap=%s - extra=%llu]\n", htx, htx->size, htx->data, htx->used, (!htx->used || htx->tail+1 == htx->wrap) ? "NO" : "YES", - (unsigned long)htx->extra); + (unsigned long long)htx->extra); fprintf(stderr, "\thead=%d - tail=%u - front=%u - wrap=%u\n", htx_get_head(htx), htx->tail, htx->front, htx->wrap);