Skip to content

Commit 2f3c6e7

Browse files
committed
Revert "Remove zlib namespacing (#1142)"
This reverts commit 5488f0b which was a good experiment to try, that didn't work out due to #1176 Fixes #1176
1 parent 13b9ecd commit 2f3c6e7

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

test/libc/runtime/zipos_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333

3434
__static_yoink("zipos");
3535
__static_yoink("libc/testlib/hyperion.txt");
36-
__static_yoink("inflate");
37-
__static_yoink("inflateInit2");
38-
__static_yoink("inflateEnd");
36+
__static_yoink("_Cz_inflate");
37+
__static_yoink("_Cz_inflateInit2");
38+
__static_yoink("_Cz_inflateEnd");
3939

4040
void *Worker(void *arg) {
4141
int i, fd;

third_party/musl/pwd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ __static_yoink("musl_libc_notice");
4545
// something as substantive as this library, then we shall assume the
4646
// application is meaty enough to benefit from the performance of the
4747
// chromium zlib library (costs ~40kb binary) versus just having puff
48-
__static_yoink("inflateInit2");
49-
__static_yoink("inflate");
50-
__static_yoink("inflateEnd");
48+
__static_yoink("_Cz_inflateInit2");
49+
__static_yoink("_Cz_inflate");
50+
__static_yoink("_Cz_inflateEnd");
5151
#endif
5252

5353
static char *

third_party/zip/crc32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifndef USE_ZLIB
3232
ZCONST ulg near *get_crc_table OF((void));
3333
#endif
34-
#if (1 || defined(USE_ZLIB) || defined(CRC_TABLE_ONLY))
34+
#if (defined(USE_ZLIB) || defined(CRC_TABLE_ONLY))
3535
# ifdef IZ_CRC_BE_OPTIMIZ
3636
# undef IZ_CRC_BE_OPTIMIZ
3737
# endif

third_party/zip/zipfile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
#include "libc/nt/winsock.h"
7373
#endif
7474

75-
unsigned crc32(unsigned crc, const unsigned char *buf, unsigned len);
75+
unsigned _Cz_crc32(unsigned crc, const unsigned char *buf, unsigned len);
7676

7777
/*
7878
* XXX start of zipfile.h
@@ -867,7 +867,7 @@ local void read_Unicode_Path_entry(pZipListEntry)
867867
}
868868
strcpy(iname, pZipListEntry->iname);
869869

870-
chksum = crc32(chksum, (uch *)(iname), strlen(iname));
870+
chksum = _Cz_crc32(chksum, (uch *)(iname), strlen(iname));
871871

872872
free(iname);
873873

@@ -972,7 +972,7 @@ local void read_Unicode_Path_local_entry(pZipListEntry)
972972
}
973973
strcpy(iname, pZipListEntry->iname);
974974

975-
chksum = crc32(chksum, (uch *)(iname), strlen(iname));
975+
chksum = _Cz_crc32(chksum, (uch *)(iname), strlen(iname));
976976

977977
free(iname);
978978

@@ -1558,7 +1558,7 @@ local int add_Unicode_Path_local_extra_field(pZEntry)
15581558
# define inameLocal (pZEntry->iname)
15591559
#endif
15601560

1561-
chksum = crc32(chksum, (uch *)(inameLocal), strlen(inameLocal));
1561+
chksum = _Cz_crc32(chksum, (uch *)(inameLocal), strlen(inameLocal));
15621562

15631563
#ifdef WIN32_OEM
15641564
free(inameLocal);
@@ -1685,7 +1685,7 @@ local int add_Unicode_Path_cen_extra_field(pZEntry)
16851685
# define inameLocal (pZEntry->iname)
16861686
#endif
16871687

1688-
chksum = crc32(chksum, (uch *)(inameLocal), strlen(inameLocal));
1688+
chksum = _Cz_crc32(chksum, (uch *)(inameLocal), strlen(inameLocal));
16891689

16901690
#ifdef WIN32_OEM
16911691
free(inameLocal);

third_party/zlib/zconf.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#define z_const const
1515

16-
#if 0
1716
#define Z_COSMO_PREFIX_SET
1817

1918
#define Bytef _Cz_Bytef
@@ -163,9 +162,6 @@
163162
#define zlibCompileFlags _Cz_zlibCompileFlags
164163
#define zlibVersion _Cz_zlibVersion
165164

166-
#pragma message "zconf is included, so zlibVersion should be renamed"
167-
168-
#endif
169165

170166
typedef unsigned char Byte;
171167
typedef unsigned int uInt; /* 16 bits or more */

0 commit comments

Comments
 (0)