]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: halog: fix a -Wundef warning on non-glibc systems
authorWilly Tarreau <w@1wt.eu>
Mon, 13 Sep 2021 07:32:01 +0000 (09:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 13 Sep 2021 07:32:01 +0000 (09:32 +0200)
Dmitry reported this warning on FreeBSD since the introduction of -Wundef:

  admin/halog/fgets2.c:38:30: warning: '__GLIBC__' is not defined, evaluates to 0 [-Wundef]
  #if defined(__x86_64__) &&  (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 15))
                               ^
A defined() was missing.

admin/halog/fgets2.c

index 3634f5576a22f6759aecc7f214431174719b81c1..62f10709427df20ea8926f63e31099ac940a587c 100644 (file)
@@ -35,7 +35,7 @@
 #endif
 
 /* memchr() is faster in glibc with SSE since commit 093ecf92998de2 */
-#if defined(__x86_64__) &&  (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 15))
+#if defined(__x86_64__) && defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 15))
 #define USE_MEMCHR
 #endif