Skip to content

Commit f768a32

Browse files
authored
Merge branch 'madler:develop' into components
2 parents c2265c2 + 9eadab4 commit f768a32

File tree

11 files changed

+650
-179
lines changed

11 files changed

+650
-179
lines changed

INDEX

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ zlib.pc.cmakein zlib.pc template for cmake
2121
zlib2ansi perl script to convert source files for C++ compilation
2222

2323
amiga/ makefiles for Amiga SAS C
24-
as400/ makefiles for AS/400
2524
doc/ documentation for formats and algorithms
2625
msdos/ makefiles for MSDOS
27-
nintendods/ makefile for Nintendo DS
2826
old/ makefiles for various architectures and zlib documentation
2927
files that have not yet been updated for zlib 1.2.x
28+
os400/ makefiles for OS/400
3029
qnx/ makefiles for QNX
3130
watcom/ makefiles for OpenWatcom
3231
win32/ makefiles for Windows

Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ test64: all64
115115
fi
116116
@rm -f tmp64_$$
117117

118-
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
118+
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h $(SRCDIR)inflate.h $(SRCDIR)inftrees.h
119119
$(CC) $(CFLAGS) $(ZINCOUT) -c -coverage -o $@ $(SRCDIR)test/infcover.c
120120

121121
infcover: infcover.o libz.a
@@ -289,7 +289,7 @@ gzwrite.lo: $(SRCDIR)gzwrite.c
289289
-@mv objs/gzwrite.o $@
290290

291291

292-
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
292+
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a $(SRCDIR)zlib.map
293293
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
294294
rm -f $(SHAREDLIB) $(SHAREDLIBM)
295295
ln -s $@ $(SHAREDLIB)

configure

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
244244
SFLAGS="${CFLAGS--O3}"
245245
if test "$ARCHS"; then
246246
CFLAGS="${CFLAGS} ${ARCHS}"
247+
SFLAGS="${SFLAGS} ${ARCHS}"
247248
LDFLAGS="${LDFLAGS} ${ARCHS}"
248249
fi
249250
if test $build64 -eq 1; then
@@ -494,7 +495,7 @@ if test $shared -eq 1; then
494495
echo Checking for shared library support... | tee -a configure.log
495496
# we must test in two steps (cc then ld), required at least on SunOS 4.x
496497
if try $CC -c $SFLAGS $test.c &&
497-
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
498+
try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then
498499
echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
499500
elif test -z "$old_cc" -a -z "$old_cflags"; then
500501
echo No shared library support. | tee -a configure.log
@@ -556,7 +557,7 @@ int main(void) {
556557
}
557558
EOF
558559
fi
559-
if try $CC $CFLAGS -o $test $test.c; then
560+
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
560561
sizet=`./$test`
561562
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
562563
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
@@ -590,7 +591,7 @@ int main(void) {
590591
return 0;
591592
}
592593
EOF
593-
if try $CC $CFLAGS -o $test $test.c; then
594+
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
594595
echo "Checking for fseeko... Yes." | tee -a configure.log
595596
else
596597
CFLAGS="${CFLAGS} -DNO_FSEEKO"
@@ -607,7 +608,7 @@ cat > $test.c <<EOF
607608
#include <errno.h>
608609
int main() { return strlen(strerror(errno)); }
609610
EOF
610-
if try $CC $CFLAGS -o $test $test.c; then
611+
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
611612
echo "Checking for strerror... Yes." | tee -a configure.log
612613
else
613614
CFLAGS="${CFLAGS} -DNO_STRERROR"
@@ -713,7 +714,7 @@ int main()
713714
return (mytest("Hello%d\n", 1));
714715
}
715716
EOF
716-
if try $CC $CFLAGS -o $test $test.c; then
717+
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
717718
echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
718719

719720
echo >> configure.log
@@ -806,7 +807,7 @@ int main()
806807
}
807808
EOF
808809

809-
if try $CC $CFLAGS -o $test $test.c; then
810+
if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
810811
echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
811812

812813
echo >> configure.log

contrib/minizip/unzip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ extern unzFile ZEXPORT unzOpen2_64(const void *path,
683683
{
684684
zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
685685
zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
686+
zlib_filefunc64_32_def_fill.zopen32_file = NULL;
686687
zlib_filefunc64_32_def_fill.ztell32_file = NULL;
687688
zlib_filefunc64_32_def_fill.zseek32_file = NULL;
688689
return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 1);

contrib/minizip/zip.c

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ extern zipFile ZEXPORT zipOpen2_64(const void *pathname, int append, zipcharpc*
11411141
{
11421142
zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;
11431143
zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;
1144+
zlib_filefunc64_32_def_fill.zopen32_file = NULL;
11441145
zlib_filefunc64_32_def_fill.ztell32_file = NULL;
11451146
zlib_filefunc64_32_def_fill.zseek32_file = NULL;
11461147
return zipOpen3(pathname, append, globalcomment, &zlib_filefunc64_32_def_fill);
@@ -1247,32 +1248,32 @@ local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt s
12471248
return err;
12481249
}
12491250

1250-
// Return the length of the UTF-8 code at str[0..len-1] in [1..4], or negative
1251-
// if there is no valid UTF-8 code there. If negative, it is minus the number
1252-
// of bytes examined in order to determine it was bad. Or if minus the return
1253-
// code is one less than len, then at least one more byte than provided would
1254-
// be needed to complete the code.
1255-
local inline int utf8len(unsigned char const *str, size_t len) {
1251+
/* Return the length of the UTF-8 code at str[0..len-1] in [1..4], or negative
1252+
if there is no valid UTF-8 code there. If negative, it is minus the number
1253+
of bytes examined in order to determine it was bad. Or if minus the return
1254+
code is one less than len, then at least one more byte than provided would
1255+
be needed to complete the code. */
1256+
local int utf8len(unsigned char const *str, size_t len) {
12561257
return
1257-
len == 0 ? -1 : // empty input
1258-
str[0] < 0x80 ? 1 : // good one-byte
1259-
str[0] < 0xc0 ? -1 : // bad first byte
1260-
len < 2 || (str[1] >> 6) != 2 ? -2 : // missing or bad second byte
1261-
str[0] < 0xc2 ? -2 : // overlong code
1262-
str[0] < 0xe0 ? 2 : // good two-byte
1263-
len < 3 || (str[2] >> 6) != 2 ? -3 : // missing or bad third byte
1264-
str[0] == 0xe0 && str[1] < 0xa0 ? -3 : // overlong code
1265-
str[0] < 0xf0 ? 3 : // good three-byte
1266-
len < 4 || (str[3] >> 6) != 2 ? -4 : // missing or bad fourth byte
1267-
str[0] == 0xf0 && str[1] < 0x90 ? -4 : // overlong code
1258+
len == 0 ? -1 : /* empty input */
1259+
str[0] < 0x80 ? 1 : /* good one-byte */
1260+
str[0] < 0xc0 ? -1 : /* bad first byte */
1261+
len < 2 || (str[1] >> 6) != 2 ? -2 : /* missing or bad 2nd byte */
1262+
str[0] < 0xc2 ? -2 : /* overlong code */
1263+
str[0] < 0xe0 ? 2 : /* good two-byte */
1264+
len < 3 || (str[2] >> 6) != 2 ? -3 : /* missing or bad 3rd byte */
1265+
str[0] == 0xe0 && str[1] < 0xa0 ? -3 : /* overlong code */
1266+
str[0] < 0xf0 ? 3 : /* good three-byte */
1267+
len < 4 || (str[3] >> 6) != 2 ? -4 : /* missing or bad 4th byte */
1268+
str[0] == 0xf0 && str[1] < 0x90 ? -4 : /* overlong code */
12681269
str[0] < 0xf4 ||
1269-
(str[0] == 0xf4 && str[1] < 0x90) ? 4 : // good four-byte
1270-
-4; // code > 0x10ffff
1270+
(str[0] == 0xf4 && str[1] < 0x90) ? 4 : /* good four-byte */
1271+
-4; /* code > 0x10ffff */
12711272
}
12721273

1273-
// Return true if str[0..len-1] is valid UTF-8 *and* it contains at least one
1274-
// code of two or more bytes. This is used to determine whether or not to set
1275-
// bit 11 in the zip header flags.
1274+
/* Return true if str[0..len-1] is valid UTF-8 *and* it contains at least one
1275+
code of two or more bytes. This is used to determine whether or not to set
1276+
bit 11 in the zip header flags. */
12761277
local int isutf8(char const *str, size_t len) {
12771278
int utf8 = 0;
12781279
while (len) {

nintendods/Makefile

Lines changed: 0 additions & 126 deletions
This file was deleted.

nintendods/README

Lines changed: 0 additions & 5 deletions
This file was deleted.

os400/make.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR"
187187
then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
188188
CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
189189
system "${CMD}"
190+
system "CHGPFM FILE(${TARGETLIB}/DOCS) MBR(`basename ${TEXT}`) SRCTYPE(TXT)"
190191
fi
191192
done
192193
@@ -221,6 +222,7 @@ do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
221222
CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DEST}')"
222223
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
223224
system "${CMD}"
225+
system "CHGPFM FILE(${TARGETLIB}/H) MBR(`basename ${HFILE} .h`) SRCTYPE(H)"
224226
# touch -r "${HFILE}" "${DEST}"
225227
rm -f tmphdrfile
226228
fi
@@ -237,14 +239,28 @@ done
237239
# Install the ILE/RPG header file.
238240
239241
240-
HFILE="${SCRIPTDIR}/zlib.inc"
241-
DEST="${SRCPF}/ZLIB.INC.MBR"
242+
HFILE="${SCRIPTDIR}/zlibfixed.rpgle"
243+
MBR="ZLIBFIXED"
244+
DEST="${SRCPF}/${MBR}.MBR"
242245
243246
if action_needed "${DEST}" "${HFILE}"
244247
then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')"
245248
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
246249
system "${CMD}"
247250
# touch -r "${HFILE}" "${DEST}"
251+
system "CHGPFM FILE(${TARGETLIB}/H) MBR(${MBR}) SRCTYPE(RPGLE)"
252+
fi
253+
254+
HFILE="${SCRIPTDIR}/zlibfree.rpgle"
255+
MBR="ZLIBFREE"
256+
DEST="${SRCPF}/${MBR}.MBR"
257+
258+
if action_needed "${DEST}" "${HFILE}"
259+
then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')"
260+
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
261+
system "${CMD}"
262+
# touch -r "${HFILE}" "${DEST}"
263+
system "CHGPFM FILE(${TARGETLIB}/H) MBR(${MBR}) SRCTYPE(RPGLE)"
248264
fi
249265
250266
IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`"
@@ -311,10 +327,11 @@ fi
311327
312328
DEST="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR"
313329
314-
if action_needed "${SCRIPTDIR}/bndsrc" "${DEST}"
330+
if action_needed "${DEST}" "${SCRIPTDIR}/bndsrc"
315331
then CMD="CPY OBJ('${SCRIPTDIR}/bndsrc') TOOBJ('${DEST}')"
316332
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
317333
system "${CMD}"
334+
system "CHGPFM FILE(${TARGETLIB}/TOOLS) MBR(BNDSRC) SRCTYPE(BND)"
318335
# touch -r "${SCRIPTDIR}/bndsrc" "${DEST}"
319336
LINK=YES
320337
fi
@@ -361,6 +378,6 @@ then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
361378
CMD="${CMD} TEXT('ZLIB dynamic binding directory')"
362379
system "${CMD}"
363380
CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
364-
CMD="${CMD} OBJ((*LIBL/${SRVPGM} *SRVPGM))"
381+
CMD="${CMD} OBJ((${TARGETLIB}/${SRVPGM} *SRVPGM))"
365382
system "${CMD}"
366383
fi

0 commit comments

Comments
 (0)