]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: compat: always set _POSIX_VERSION to ease comparisons
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Aug 2025 13:59:11 +0000 (15:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Aug 2025 17:19:27 +0000 (19:19 +0200)
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

index ad91b901c58dff92f309ca9d0aa4cbc93f599808..39f7af7a69d6a3f898e1951df8e59f7f27f5442f 100644 (file)
@@ -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