]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: fix coexistence of openssl and zlib
authorWilly Tarreau <w@1wt.eu>
Fri, 26 Oct 2012 13:05:35 +0000 (15:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 Oct 2012 13:07:59 +0000 (15:07 +0200)
The crappy zlib and openssl libs both define a free_func as a different typedef.
That's a very clever idea to use such a generic name in general purpose libraries,
really... The zlib one is easier to redefine than openssl's, so let's only fix this
one.

src/compression.c

index 45244a075d6a998402395b2b38641bfea2bc86f8..3ff3aea9a79632f2c1d49001aa62dd1d3cadf622 100644 (file)
  */
 
 #include <stdio.h>
+
+/* Note: the crappy zlib and openssl libs both define the "free_func" type.
+ * That's a very clever idea to use such a generic name in general purpose
+ * libraries, really... The zlib one is easier to redefine than openssl's,
+ * so let's only fix this one.
+ */
+#define free_func zlib_free_func
 #include <zlib.h>
+#undef free_func
 
 #include <common/compat.h>