]> arthur.barton.de Git - netatalk.git/blobdiff - libevent/test/regress_zlib.c
Update libevent to 2.0.12
[netatalk.git] / libevent / test / regress_zlib.c
index 158d0d611425ee4de230e8657b110a2376c120c9..6dd7bf8f611e0feb60e1142f39987b47cf78c73b 100644 (file)
@@ -46,7 +46,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <zlib.h>
 #include <assert.h>
 #include <errno.h>
 
 
 #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 <zlib.h>
+
 static int infilter_calls;
 static int outfilter_calls;
 static int readcb_finished;
@@ -276,6 +297,7 @@ test_bufferevent_zlib(void *arg)
        tt_int_op(r, ==, Z_OK);
        memset(&z_input, 0, sizeof(z_input));
        r = inflateInit(&z_input);
+       tt_int_op(r, ==, Z_OK);
 
        /* initialize filters */
        bev1 = bufferevent_filter_new(bev1, NULL, zlib_output_filter,