From e921fe894f6b992414e595be9450a9092f4df48e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 5 Aug 2025 15:59:11 +0200 Subject: [PATCH] BUILD: compat: always set _POSIX_VERSION to ease comparisons Sometimes we need to compare it to known versions, let's make sure it's always defined. We set it to zero if undefined so that it cannot match any comparison. --- include/haproxy/compat.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index ad91b901c..39f7af7a6 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -120,6 +120,11 @@ typedef struct { } empty_t; }) #endif +/* always set a _POSIX_VERSION if there isn't any, in order to ease compares */ +#ifndef _POSIX_VERSION +# define _POSIX_VERSION 0 +#endif + /* this is for libc5 for example */ #ifndef TCP_NODELAY #define TCP_NODELAY 1 -- 2.47.3