The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
55545 ripley 1
There are a very few to the source code of zlib-1.2.5 used here.
55531 ripley 2
 
55545 ripley 3
zconf.h includes R's config.h
39872 ripley 4
 
52455 ripley 5
Makefile.in is ours, not zlib's, and allows us to use PIC flags so this
6
can be included in libR.so.
7
 
54790 ripley 8
As from R 2.12.2, on a Unix-alike we remap all the symbols (not just
9
those remapped by defining Z_PREFIX) to avoid conflict with system
10
versions of zlib (notably 1.2.5) linked into packages' *.so.  The
11
known problems are with libxml2 and libggobi, both of which are linked
12
to libz.  This is not needed on Windows where the DLL is named
54142 ripley 13
Rzlib.dll and symbols are imported from a named DLL.  But Rzlib.def is
14
used to confine exports to symbols marked ZEXPORT in zlib.h.
54123 ripley 15
 
54786 ripley 16
From 2.13.0, Z_PREFIX is defined in zconf.h, except on Windows.
54123 ripley 17
 
55545 ripley 18
Visibility does not work on all platforms in gcc >= 3.3.
54786 ripley 19
 
55545 ripley 20
diff -u /Users/ripley/Sources/zlib-1.2.5/zconf.h ./zconf.h
21
--- /Users/ripley/Sources/zlib-1.2.5/zconf.h	2010-04-18 18:58:06.000000000 +0100
22
+++ ./zconf.h	2011-04-19 18:49:24.000000000 +0100
23
@@ -8,127 +8,84 @@
24
 #ifndef ZCONF_H
25
 #define ZCONF_H
52455 ripley 26
 
27
+#ifdef HAVE_CONFIG_H
28
+#include <config.h>
29
+#endif
30
+
55545 ripley 31
+/* R change */
32
+#ifndef WIN32
33
+#define Z_PREFIX
52455 ripley 34
+#endif
55545 ripley 35
 
36
plus lots of changes to the defines.
37
 
38
diff -u /Users/ripley/Sources/zlib-1.2.5/zlib.h ./zlib.h
39
--- /Users/ripley/Sources/zlib-1.2.5/zlib.h	2010-04-20 05:12:48.000000000 +0100
40
+++ ./zlib.h	2011-04-19 22:18:56.000000000 +0100
41
@@ -1576,8 +1576,15 @@
42
 #  define gzseek gzseek64
43
 #  define gztell gztell64
44
 #  define gzoffset gzoffset64
45
+#  undef adler32_combine
46
+#  undef crc32_combine
47
+# ifdef Z_PREFIX
48
+#  define adler32_combine Rz_adler32_combine64
49
+#  define crc32_combine Rz_crc32_combine64
50
+# else
51
 #  define adler32_combine adler32_combine64
52
 #  define crc32_combine crc32_combine64
53
+# endif
54
 #  ifdef _LARGEFILE64_SOURCE
55
      ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
56
      ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
57
 
58
diff -u /Users/ripley/Sources/zlib-1.2.5/zutil.h ./zutil.h
59
--- /Users/ripley/Sources/zlib-1.2.5/zutil.h	2010-04-18 20:29:24.000000000 +0100
60
+++ ./zutil.h	2011-04-19 19:41:57.000000000 +0100
61
@@ -13,6 +13,10 @@
62
 #ifndef ZUTIL_H
63
 #define ZUTIL_H
52455 ripley 64
 
55545 ripley 65
+#ifdef WIN32
66
+# define NO_VIZ
52455 ripley 67
+#endif
68
+
55545 ripley 69
 #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
70
 #  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
71
 #else