update known-issues
[mono.git] / support / zlib_macros.c
index 69423f2339bd5b533a7fdc0b529d753748889241..d022e041047a6bc6d60ffb9179b63a2278880d90 100644 (file)
@@ -6,7 +6,13 @@
  *
  * (C) 2004 Novell, Inc.
  */
+#include <config.h>
+#if defined (HAVE_ZLIB)
 #include <zlib.h>
+#else
+#include "zlib.h"
+#endif
+
 #include <stdlib.h>
 
 z_stream *
@@ -15,6 +21,11 @@ create_z_stream(int compress, unsigned char gzip)
        z_stream *z;
        int retval;
 
+#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204)
+       /* Older versions of zlib do not support raw deflate or gzip */
+       return NULL;
+#endif
+
        z = malloc (sizeof (z_stream));
        z->next_in = Z_NULL;
        z->avail_in = 0;