summaryrefslogtreecommitdiff
path: root/games-util/dzip/files/dzip-2.9-system-zlib-r2.patch
blob: 668ef369dfe065560640918828e8210d5b304be3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- a/dzip.h
+++ b/dzip.h
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "zlib/zlib.h"
+#include <zlib.h>
 
 typedef unsigned char uchar;
 
@@ -177,4 +177,4 @@
 #else
 #define DIRCHAR '/'
 #define WRONGCHAR '\\'
-#endif
\ No newline at end of file
+#endif
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -1,18 +1,17 @@
 # Makefile for linux
 
-CC = gcc
-CFLAGS = -Wall -O3
+CC ?= gcc
+CFLAGS ?= -O3
+CFLAGS += -Wall
 TARGET = dzip
 OBJECTS = main.o compress.o uncompress.o list.o crc32.o \
-	  encode.o decode.o v1code.o conmain.o delete.o \
-	  zlib/adler32.o zlib/deflate.o zlib/trees.o \
-	  zlib/inflate.o zlib/infblock.o zlib/inftrees.o zlib/infcodes.o \
-	  zlib/infutil.o zlib/inffast.o
+	  encode.o decode.o v1code.o conmain.o delete.o
+LIBS = -lz
 
 TMPFILES = gmon.out frag*
 
 $(TARGET): $(OBJECTS)
-	$(CC) $(CFLAGS) $(OBJECTS) -o $(TARGET) $(LDFLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
 
 clean:
 	rm -f $(TARGET) $(OBJECTS) $(TMPFILES)
@@ -24,4 +23,4 @@
 encode.o: encode.c dzip.h
 list.o: list.c dzip.h dzipcon.h
 decode.o: decode.c dzip.h dzipcon.h
-v1code.o: v1code.c dzip.h dzipcon.h
\ No newline at end of file
+v1code.o: v1code.c dzip.h dzipcon.h
--- a/conmain.c
+++ b/conmain.c
@@ -507,8 +507,8 @@
 		if (!strcmp(argv[i],"-o")) i++;
 	}
 
-	zs.zalloc = Dzip_calloc;
-	zs.zfree = free;
+	zs.zalloc = Z_NULL; // Dzip_calloc; <- wrong number of arguments, reverting to default
+	zs.zfree = Z_NULL;  // free; 	    <- wrong number of arguments, reverting to default
 
 	if (flag[SW_LIST] || flag[SW_EXTRACT] || flag[SW_VERIFY])
 	{
@@ -618,4 +618,4 @@
 		dzDeleteFiles_MakeList(files + 1, fileargs - 1);
 	free(files);
 	exit(0);
-}
\ No newline at end of file
+}