From 5786b91e2e779a9cab7292493b11ed82e057d18e Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Thu, 5 May 2011 18:02:42 +0200 Subject: [PATCH] Fix a compile warning with zlib 1.2.4 and 1.2.5 I took this fix from Tor (commit 1a52e39c22d5, author Nick Mathewson, Copyright (c) 2007-2011, The Tor Project, Inc.) and adapted it slightly for libevent. --- test/regress_zlib.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/regress_zlib.c b/test/regress_zlib.c index 12ddcca9..6dd7bf8f 100644 --- a/test/regress_zlib.c +++ b/test/regress_zlib.c @@ -46,7 +46,6 @@ #include #include -#include #include #include @@ -58,6 +57,28 @@ #include "regress.h" +/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of + saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory + that nobody will care if the compile outputs a no-such-identifier warning. + + Sorry, but we like -Werror over here, so I guess we need to define these. + I hope that zlib 1.2.6 doesn't break these too. +*/ +#ifndef _LARGEFILE64_SOURCE +#define _LARGEFILE64_SOURCE 0 +#endif +#ifndef _LFS64_LARGEFILE +#define _LFS64_LARGEFILE 0 +#endif +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 0 +#endif +#ifndef off64_t +#define off64_t ev_int64_t +#endif + +#include + static int infilter_calls; static int outfilter_calls; static int readcb_finished;