[mkbundle] Correct some linking options for Windows
[mono.git] / mcs / tools / mkbundle / template_z.c
index 7aac318bb88f91034569adbdc887bd2d593aa457..f40641c21f965af39738ddd53fad6067e24f632e 100644 (file)
@@ -1,5 +1,6 @@
 static MonoBundledAssembly **bundled;
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <zlib.h>
@@ -13,7 +14,9 @@ my_inflate (const Byte *compr, uLong compr_len, Byte *uncompr, uLong uncompr_len
        memset (&stream, 0, sizeof (z_stream));
        stream.next_in = (Byte *) compr;
        stream.avail_in = (uInt) compr_len;
-       err = inflateInit (&stream);
+
+       // http://www.zlib.net/manual.html
+       err = inflateInit2 (&stream, 16+MAX_WBITS);
        if (err != Z_OK)
                return 1;
 
@@ -66,7 +69,7 @@ void mono_mkbundle_init ()
                buffer = (Bytef *) malloc (real_size);
                result = my_inflate ((*ptr)->assembly.data, zsize, buffer, real_size);
                if (result != 0) {
-                       fprintf (stderr, "Error %d decompresing data for %s\n", result, (*ptr)->assembly.name);
+                       fprintf (stderr, "mkbundle: Error %d decompressing data for %s\n", result, (*ptr)->assembly.name);
                        exit (1);
                }
                (*ptr)->assembly.data = buffer;