*.c text
*.h text
Makefile text
+configure text eol=lf
+testCVEinputs.sh text eol=lf
\ No newline at end of file
endif()
# Parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
-file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib${SUFFIX}.h _zlib_h_contents)
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib${SUFFIX}.h.in _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9]+.[0-9]+.[0-9]+).*\".*"
"\\1" ZLIB_HEADER_VERSION ${_zlib_h_contents})
string(REGEX REPLACE ".*#define[ \t]+ZLIBNG_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
option(WITH_INFLATE_ALLOW_INVALID_DIST "Build with zero fill for inflate invalid distances" OFF)
option(WITH_UNALIGNED "Support unaligned reads on platforms that support it" ON)
+set(ZLIB_SYMBOL_PREFIX "" CACHE STRING "Give this prefix to all publicly exported symbols.
+Useful when embedding into a larger library.
+Default is no prefix (empty prefix).")
+
# Add multi-choice option
set(WITH_SANITIZER AUTO CACHE STRING "Enable sanitizer support")
set_property(CACHE WITH_SANITIZER PROPERTY STRINGS "Memory" "Address" "Undefined" "Thread")
option(INSTALL_UTILS "Copy minigzip and minideflate during install" OFF)
mark_as_advanced(FORCE
+ ZLIB_SYMBOL_PREFIX
ZLIB_DUAL_LINK
WITH_REDUCED_MEM
WITH_ACLE WITH_NEON
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf${SUFFIX}.h
- zlib${SUFFIX}.h
+ ${CMAKE_CURRENT_BINARY_DIR}/zlib_name_mangling${SUFFIX}.h
+ ${CMAKE_CURRENT_BINARY_DIR}/zlib${SUFFIX}.h
)
set(ZLIB_PRIVATE_HDRS
adler32_p.h
)
set(ZLIB_GZFILE_SRCS
gzlib.c
- gzread.c
+ ${CMAKE_CURRENT_BINARY_DIR}/gzread.c
gzwrite.c
)
${ZLIB_PC} @ONLY)
configure_file(${CMAKE_CURRENT_BINARY_DIR}/zconf${SUFFIX}.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf${SUFFIX}.h @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlib${SUFFIX}.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/zlib${SUFFIX}.h @ONLY)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gzread.c.in
+ ${CMAKE_CURRENT_BINARY_DIR}/gzread.c @ONLY)
+
+
+if (NOT ZLIB_SYMBOL_PREFIX STREQUAL "")
+ add_feature_info(ZLIB_SYMBOL_PREFIX ON "Publicly exported symbols have a custom prefix")
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlib_name_mangling${SUFFIX}.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/zlib_name_mangling${SUFFIX}.h @ONLY)
+else()
+ add_feature_info(ZLIB_SYMBOL_PREFIX OFF "Publicly exported symbols DO NOT have a custom prefix")
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlib_name_mangling.h.empty
+ ${CMAKE_CURRENT_BINARY_DIR}/zlib_name_mangling${SUFFIX}.h COPYONLY)
+endif()
+# add_definitions(-DZLIB_SYMBOL_PREFIX=${ZLIB_SYMBOL_PREFIX}) # not needed
+
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install(TARGETS ${ZLIB_INSTALL_LIBRARIES}
LIBRARY DESTINATION "${LIB_INSTALL_DIR}")
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
- install(FILES zlib${SUFFIX}.h
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zlib${SUFFIX}.h
DESTINATION "${INC_INSTALL_DIR}" RENAME zlib${SUFFIX}.h)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zlib_name_mangling${SUFFIX}.h
+ DESTINATION "${INC_INSTALL_DIR}" RENAME zlib_name_mangling${SUFFIX}.h)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zconf${SUFFIX}.h
DESTINATION "${INC_INSTALL_DIR}" RENAME zconf${SUFFIX}.h)
endif()
SRCDIR=.
INCLUDES=-I$(SRCDIR)
+BUILDDIR=.
+
ARCHDIR=arch/generic
ARCH_STATIC_OBJS=
ARCH_SHARED_OBJS=
minigzip_fuzzer$(EXE): minigzip_fuzzer.o standalone_fuzz_target_runner.o $(OBJG) $(STATICLIB)
$(CC) $(LDFLAGS) -o $@ $(LIB_FUZZING_ENGINE) minigzip_fuzzer.o $(OBJG) $(STATICLIB) -lpthread
-infcover.o: $(SRCDIR)/test/infcover.c $(SRCDIR)/zlib$(SUFFIX).h zconf$(SUFFIX).h
+infcover.o: $(SRCDIR)/test/infcover.c zlib$(SUFFIX).h zconf$(SUFFIX).h zlib_name_mangling$(SUFFIX).h
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c
infcover$(EXE): infcover.o $(STATICLIB)
%.lo: $(SRCDIR)/%.c
$(CC) $(SFLAGS) -DPIC $(INCLUDES) -c -o $@ $<
-$(OBJG): %.o: $(SRCDIR)/%.c
+gzlib.o: $(SRCDIR)/gzlib.c
+ $(CC) $(CFLAGS) -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+
+gzlib.lo: $(SRCDIR)/gzlib.c
+ $(CC) $(SFLAGS) -DPIC -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+
+gzread.o: gzread.c
$(CC) $(CFLAGS) -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+gzread.lo: gzread.c
+ $(CC) $(SFLAGS) -DPIC -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+
+gzwrite.o: $(SRCDIR)/gzwrite.c
+ $(CC) $(CFLAGS) -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+
+gzwrite.lo: $(SRCDIR)/gzwrite.c
+ $(CC) $(SFLAGS) -DPIC -DWITH_GZFILEOP $(INCLUDES) -c -o $@ $<
+
$(SHAREDTARGET): $(PIC_OBJS) $(DEFFILE) $(RCOBJS)
ifneq ($(SHAREDTARGET),)
$(LDSHARED) $(CFLAGS) $(LDSHAREDFLAGS) $(LDFLAGS) -o $@ $(DEFFILE) $(PIC_OBJS) $(RCOBJS) $(LDSHAREDLIBC)
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
- rm -f $(DESTDIR)$(includedir)/zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zconf$(SUFFIX).h
- cp $(SRCDIR)/zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zlib$(SUFFIX).h
+ rm -f $(DESTDIR)$(includedir)/zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zconf$(SUFFIX).h $(DESTDIR)$(includedir)/zlib_name_mangling$(SUFFIX).h
+ cp zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zlib$(SUFFIX).h
cp zconf$(SUFFIX).h $(DESTDIR)$(includedir)/zconf$(SUFFIX).h
- chmod 644 $(DESTDIR)$(includedir)/zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zconf$(SUFFIX).h
+ cp zlib_name_mangling$(SUFFIX).h $(DESTDIR)$(includedir)/zlib_name_mangling$(SUFFIX).h
+ chmod 644 $(DESTDIR)$(includedir)/zlib$(SUFFIX).h $(DESTDIR)$(includedir)/zconf$(SUFFIX).h $(DESTDIR)$(includedir)/zlib_name_mangling$(SUFFIX).h
uninstall-static:
cd $(DESTDIR)$(libdir) && rm -f $(STATICLIB)
endif
uninstall: uninstall-static uninstall-shared
- cd $(DESTDIR)$(includedir) && rm -f zlib$(SUFFIX).h zconf$(SUFFIX).h
+ cd $(DESTDIR)$(includedir) && rm -f zlib$(SUFFIX).h zconf$(SUFFIX).h zlib_name_mangling$(SUFFIX).h
cd $(DESTDIR)$(pkgconfigdir) && rm -f $(PKGFILE)
mostlyclean: clean
distclean: clean
@if [ -f $(ARCHDIR)/Makefile ]; then $(MAKE) -C $(ARCHDIR) distclean; fi
@if [ -f test/Makefile ]; then $(MAKE) -C test distclean; fi
- rm -f $(PKGFILE) configure.log zconf.h zconf.h.cmakein
+ rm -f $(PKGFILE) configure.log zconf.h zconf.h.cmakein zlib$(SUFFIX).h zlib_name_mangling$(SUFFIX)}.h
-@rm -f .DS_Store
# Reset Makefile if building inside source tree
@if [ -f Makefile.in ]; then \
noltoflag="-fno-lto"
vgfmaflag="-march=z13"
vmxflag="-maltivec"
+symbol_prefix=""
without_optimizations=0
without_new_strategies=0
reducedmem=0
echo ' configure [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
echo ' [--static] [--32] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
+ echo ' [--sprefix=SYMBOL_PREFIX] Adds a prefix to all exported symbols' | tee -a configure.log
echo ' [--warn] Enables extra compiler warnings' | tee -a configure.log
echo ' [--debug] Enables extra debug prints during operation' | tee -a configure.log
echo ' [--zlib-compat] Compiles for zlib-compatible API instead of zlib-ng API' | tee -a configure.log
exit 0 ;;
-p*=* | --prefix=*) prefix=$(echo $1 | sed 's/.*=//'); shift ;;
-e*=* | --eprefix=*) exec_prefix=$(echo $1 | sed 's/.*=//'); shift ;;
+ -m*=* | --sprefix=*) symbol_prefix=$(echo $1 | sed 's/.*=//'); shift ;;
-l*=* | --libdir=*) libdir=$(echo $1 | sed 's/.*=//'); shift ;;
--sharedlibdir=*) sharedlibdir=$(echo $1 | sed 's/.*=//'); shift ;;
-i*=* | --includedir=*) includedir=$(echo $1 | sed 's/.*=//');shift ;;
-u*=* | --uname=*) uname=$(echo $1 | sed 's/.*=//');shift ;;
-p* | --prefix) prefix="$2"; shift; shift ;;
-e* | --eprefix) exec_prefix="$2"; shift; shift ;;
+ -m* | --sprefix) symbol_prefix="$2"; shift; shift ;;
-l* | --libdir) libdir="$2"; shift; shift ;;
-i* | --includedir) includedir="$2"; shift; shift ;;
-s* | --shared | --enable-shared) shared=1; shift ;;
# extract zlib version numbers from zlib.h
if test $compat -eq 0; then
- VER=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}/zlib-ng.h)
- VER3=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' < ${SRCDIR}/zlib-ng.h)
- VER2=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\.[0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib-ng.h)
- VER1=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib-ng.h)
+ VER=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}/zlib-ng.h.in)
+ VER3=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' < ${SRCDIR}/zlib-ng.h.in)
+ VER2=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\.[0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib-ng.h.in)
+ VER1=$(sed -n -e '/ZLIBNG_VERSION "/s/.*"\([0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib-ng.h.in)
else
- VER=$(sed -n -e '/ZLIB_VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}/zlib.h)
- VER3=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' < ${SRCDIR}/zlib.h)
- VER2=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\.[0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib.h)
- VER1=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib.h)
+ VER=$(sed -n -e '/ZLIB_VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}/zlib.h.in)
+ VER3=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' < ${SRCDIR}/zlib.h.in)
+ VER2=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\.[0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib.h.in)
+ VER1=$(sed -n -e '/ZLIB_VERSION "/s/.*"\([0-9]*\)\..*/\1/p' < ${SRCDIR}/zlib.h.in)
fi
show $cc -c $test.c
echo "Checking for strerror... No." | tee -a configure.log
fi
-# We need to remove zconf.h from source directory if building outside of it
+# We need to remove consigured files (zconf.h etc) from source directory if building outside of it
if [ "$SRCDIR" != "$BUILDDIR" ]; then
rm -f $SRCDIR/zconf${SUFFIX}.h
+ rm -f $SRCDIR/zlib${SUFFIX}.h
+ rm -f $SRCDIR/zlib_name_mangling${SUFFIX}.h
+fi
+
+# Rename @ZLIB_SYMBOL_PREFIX@ to $symbol_prefix in gzread.c, zlib.h and zlib_name_mangling.h
+sed < $SRCDIR/gzread.c.in "s/@ZLIB_SYMBOL_PREFIX@/$symbol_prefix/g" > gzread.c
+sed < $SRCDIR/zlib${SUFFIX}.h.in "s/@ZLIB_SYMBOL_PREFIX@/$symbol_prefix/g" > zlib${SUFFIX}.h
+if [[ ! -z $symbol_prefix ]]; then
+ sed < $SRCDIR/zlib_name_mangling${SUFFIX}.h.in "s/@ZLIB_SYMBOL_PREFIX@/$symbol_prefix/g" > zlib_name_mangling${SUFFIX}.h
+else
+ # symbol_prefix is not set, copy the empty mangling header
+ cp -p $SRCDIR/zlib_name_mangling.h.empty zlib_name_mangling${SUFFIX}.h
fi
# copy clean zconf.h for subsequent edits
echo libdir = $libdir >> configure.log
echo mandir = $mandir >> configure.log
echo prefix = $prefix >> configure.log
+echo symbol_prefix = $symbol_prefix >> configure.log
echo sharedlibdir = $sharedlibdir >> configure.log
echo uname = $uname >> configure.log
echo sse2flag = $sse2flag >> configure.log
/^prefix *=/s#=.*#= $prefix#
/^exec_prefix *=/s#=.*#= $exec_prefix#
/^bindir *=/s#=.*#= $bindir#
+/^symbol_prefix *=/s#=.*#= $symbol_prefix#
/^libdir *=/s#=.*#= $libdir#
/^sharedlibdir *=/s#=.*#= $sharedlibdir#
/^includedir *=/s#=.*#= $includedir#
/^SUFFIX *=/s#=.*#=$SUFFIX#
/^SRCDIR *=/s#=.*#=$SRCDIR/$ARCHDIR#
/^SRCTOP *=/s#=.*#=$SRCDIR#
-/^TOPDIR *=/s#=.*#=$BUILDDIR#
+/^BUILDDIR *=/s#=.*#=$BUILDDIR#
/^AVX2FLAG *=/s#=.*#=$avx2flag#
/^SSE2FLAG *=/s#=.*#=$sse2flag#
/^SSSE3FLAG *=/s#=.*#=$ssse3flag#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^bindir *=/s#=.*#=$bindir#
+/^symbol_prefix *=/s#=.*#=$symbol_prefix#
/^libdir *=/s#=.*#=$libdir#
/^sharedlibdir *=/s#=.*#=$sharedlibdir#
/^includedir *=/s#=.*#=$includedir#
}
/* -- see zlib.h -- */
-#undef gzgetc
-#undef zng_gzgetc
+#undef @ZLIB_SYMBOL_PREFIX@gzgetc
+#undef @ZLIB_SYMBOL_PREFIX@zng_gzgetc
int Z_EXPORT PREFIX(gzgetc)(gzFile file) {
unsigned char buf[1];
gz_state *state;
STATICLIB = zlib.lib
SHAREDLIB = zlib1.dll
IMPLIB = zdll.lib
+SYMBOL_PREFIX =
CC = cl
LD = link
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
example.exe minigzip.exe example_d.exe minigzip_d.exe
-zconf: $(TOP)/zconf$(SUFFIX).h.in
- $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+!if "$(SYMBOL_PREFIX)" != ""
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib_name_mangling$(SUFFIX).h.in zlib_name_mangling$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+!else
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling.h.empty
+ $(CP) $(TOP)\zlib_name_mangling.h.empty zlib_name_mangling$(SUFFIX).h
+!endif
+
+zlib$(SUFFIX).h: zlib$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib$(SUFFIX).h.in zlib$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+gzread.c: gzread.c.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\gzread.c.in gzread.c "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+zconf: $(TOP)/zconf$(SUFFIX).h.in $(TOP)/zlib$(SUFFIX).h $(TOP)/zlib_name_mangling$(SUFFIX).h
+ $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+
+$(TOP)/win32/$(DEFFILE): $(TOP)/win32/$(DEFFILE).in
+ cscript $(TOP)\win32\replace.vbs $(TOP)/win32/$(DEFFILE).in $(TOP)/win32/$(DEFFILE) "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
$(STATICLIB): zconf $(OBJS)
$(AR) $(ARFLAGS) -out:$@ $(OBJS)
distclean: clean
-del zconf$(SUFFIX).h
+ -del zlib$(SUFFIX).h
+ -del zlib_name_mangling$(SUFFIX).h
+ -del $(TOP)\win32\zlib.def
+ -del $(TOP)\win32\zlibcompat.def
+ -del $(TOP)\win32\zlib-ng.def
+ -del gzread.c
STATICLIB = zlib.lib
SHAREDLIB = zlib1.dll
IMPLIB = zdll.lib
+SYMBOL_PREFIX =
CC = cl
LD = link
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
example.exe minigzip.exe example_d.exe minigzip_d.exe
-zconf: $(TOP)/zconf$(SUFFIX).h.in
- $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+!if "$(SYMBOL_PREFIX)" != ""
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib_name_mangling$(SUFFIX).h.in zlib_name_mangling$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+!else
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling.h.empty
+ $(CP) $(TOP)\zlib_name_mangling.h.empty zlib_name_mangling$(SUFFIX).h
+!endif
+
+zlib$(SUFFIX).h: zlib$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib$(SUFFIX).h.in zlib$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+gzread.c: gzread.c.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\gzread.c.in gzread.c "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+zconf: $(TOP)/zconf$(SUFFIX).h.in $(TOP)/zlib$(SUFFIX).h $(TOP)/zlib_name_mangling$(SUFFIX).h
+ $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+
+$(TOP)/win32/$(DEFFILE): $(TOP)/win32/$(DEFFILE).in
+ cscript $(TOP)\win32\replace.vbs $(TOP)/win32/$(DEFFILE).in $(TOP)/win32/$(DEFFILE) "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
$(STATICLIB): zconf $(OBJS)
$(AR) $(ARFLAGS) -out:$@ $(OBJS)
distclean: clean
-del zconf$(SUFFIX).h
+ -del zlib$(SUFFIX).h
+ -del zlib_name_mangling$(SUFFIX).h
+ -del $(TOP)\win32\zlib.def
+ -del $(TOP)\win32\zlibcompat.def
+ -del $(TOP)\win32\zlib-ng.def
+ -del gzread.c
STATICLIB = zlib.lib
SHAREDLIB = zlib1.dll
IMPLIB = zdll.lib
+SYMBOL_PREFIX =
CC = cl
LD = link
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
example.exe minigzip.exe example_d.exe minigzip_d.exe
-zconf: $(TOP)/zconf$(SUFFIX).h.in
- $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+!if "$(SYMBOL_PREFIX)" != ""
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib_name_mangling$(SUFFIX).h.in zlib_name_mangling$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+!else
+zlib_name_mangling$(SUFFIX).h: zlib_name_mangling.h.empty
+ $(CP) $(TOP)\zlib_name_mangling.h.empty zlib_name_mangling$(SUFFIX).h
+!endif
+
+zlib$(SUFFIX).h: zlib$(SUFFIX).h.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\zlib$(SUFFIX).h.in zlib$(SUFFIX).h "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+gzread.c: gzread.c.in
+ cscript $(TOP)\win32\replace.vbs $(TOP)\gzread.c.in gzread.c "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
+
+zconf: $(TOP)/zconf$(SUFFIX).h.in $(TOP)/zlib$(SUFFIX).h $(TOP)/zlib_name_mangling$(SUFFIX).h
+ $(CP) $(TOP)\zconf$(SUFFIX).h.in $(TOP)\zconf$(SUFFIX).h
+
+$(TOP)/win32/$(DEFFILE): $(TOP)/win32/$(DEFFILE).in
+ cscript $(TOP)\win32\replace.vbs $(TOP)/win32/$(DEFFILE).in $(TOP)/win32/$(DEFFILE) "@ZLIB_SYMBOL_PREFIX@" "$(SYMBOL_PREFIX)"
$(STATICLIB): zconf $(OBJS)
$(AR) $(ARFLAGS) -out:$@ $(OBJS)
distclean: clean
-del zconf$(SUFFIX).h
+ -del zlib$(SUFFIX).h
+ -del zlib_name_mangling$(SUFFIX).h
+ -del $(TOP)\win32\zlib.def
+ -del $(TOP)\win32\zlibcompat.def
+ -del $(TOP)\win32\zlib-ng.def
+ -del gzread.c
--- /dev/null
+strInputFileName = Wscript.Arguments(0)
+strOutputFileName = Wscript.Arguments(1)
+strOldText = Wscript.Arguments(2)
+strNewText = Wscript.Arguments(3)
+
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+Set objFile = objFSO.OpenTextFile(strInputFileName, 1)
+
+strText = objFile.ReadAll
+objFile.Close
+strNewText = Replace(strText, strOldText, strNewText)
+
+Set objFile = objFSO.OpenTextFile(strOutputFileName, 2, True)
+objFile.Write strNewText
+objFile.Close
+++ /dev/null
-; zlib-ng data compression library
-EXPORTS
-; basic functions
- zlibng_version
- zng_deflate
- zng_deflateEnd
- zng_inflate
- zng_inflateEnd
-; advanced functions
- zng_deflateSetDictionary
- zng_deflateGetDictionary
- zng_deflateCopy
- zng_deflateReset
- zng_deflateParams
- zng_deflateTune
- zng_deflateBound
- zng_deflatePending
- zng_deflatePrime
- zng_deflateSetHeader
- zng_deflateSetParams
- zng_deflateGetParams
- zng_inflateSetDictionary
- zng_inflateGetDictionary
- zng_inflateSync
- zng_inflateCopy
- zng_inflateReset
- zng_inflateReset2
- zng_inflatePrime
- zng_inflateMark
- zng_inflateGetHeader
- zng_inflateBack
- zng_inflateBackEnd
- zng_zlibCompileFlags
-; utility functions
- zng_compress
- zng_compress2
- zng_compressBound
- zng_uncompress
- zng_uncompress2
-; checksum functions
- zng_adler32
- zng_adler32_z
- zng_crc32
- zng_crc32_z
- zng_adler32_combine
- zng_crc32_combine
-; various hacks, don't look :)
- zng_deflateInit_
- zng_deflateInit2_
- zng_inflateInit_
- zng_inflateInit2_
- zng_inflateBackInit_
- zng_zError
- zng_inflateSyncPoint
- zng_get_crc_table
- zng_inflateUndermine
- zng_inflateValidate
- zng_inflateCodesUsed
- zng_inflateResetKeep
- zng_deflateResetKeep
--- /dev/null
+; zlib-ng data compression library
+EXPORTS
+; basic functions
+ @ZLIB_SYMBOL_PREFIX@zlibng_version
+ @ZLIB_SYMBOL_PREFIX@zng_deflate
+ @ZLIB_SYMBOL_PREFIX@zng_deflateEnd
+ @ZLIB_SYMBOL_PREFIX@zng_inflate
+ @ZLIB_SYMBOL_PREFIX@zng_inflateEnd
+; advanced functions
+ @ZLIB_SYMBOL_PREFIX@zng_deflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@zng_deflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@zng_deflateCopy
+ @ZLIB_SYMBOL_PREFIX@zng_deflateReset
+ @ZLIB_SYMBOL_PREFIX@zng_deflateParams
+ @ZLIB_SYMBOL_PREFIX@zng_deflateTune
+ @ZLIB_SYMBOL_PREFIX@zng_deflateBound
+ @ZLIB_SYMBOL_PREFIX@zng_deflatePending
+ @ZLIB_SYMBOL_PREFIX@zng_deflatePrime
+ @ZLIB_SYMBOL_PREFIX@zng_deflateSetHeader
+ @ZLIB_SYMBOL_PREFIX@zng_deflateSetParams
+ @ZLIB_SYMBOL_PREFIX@zng_deflateGetParams
+ @ZLIB_SYMBOL_PREFIX@zng_inflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@zng_inflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@zng_inflateSync
+ @ZLIB_SYMBOL_PREFIX@zng_inflateCopy
+ @ZLIB_SYMBOL_PREFIX@zng_inflateReset
+ @ZLIB_SYMBOL_PREFIX@zng_inflateReset2
+ @ZLIB_SYMBOL_PREFIX@zng_inflatePrime
+ @ZLIB_SYMBOL_PREFIX@zng_inflateMark
+ @ZLIB_SYMBOL_PREFIX@zng_inflateGetHeader
+ @ZLIB_SYMBOL_PREFIX@zng_inflateBack
+ @ZLIB_SYMBOL_PREFIX@zng_inflateBackEnd
+ @ZLIB_SYMBOL_PREFIX@zng_zlibCompileFlags
+; utility functions
+ @ZLIB_SYMBOL_PREFIX@zng_compress
+ @ZLIB_SYMBOL_PREFIX@zng_compress2
+ @ZLIB_SYMBOL_PREFIX@zng_compressBound
+ @ZLIB_SYMBOL_PREFIX@zng_uncompress
+ @ZLIB_SYMBOL_PREFIX@zng_uncompress2
+; checksum functions
+ @ZLIB_SYMBOL_PREFIX@zng_adler32
+ @ZLIB_SYMBOL_PREFIX@zng_adler32_z
+ @ZLIB_SYMBOL_PREFIX@zng_crc32
+ @ZLIB_SYMBOL_PREFIX@zng_crc32_z
+ @ZLIB_SYMBOL_PREFIX@zng_adler32_combine
+ @ZLIB_SYMBOL_PREFIX@zng_crc32_combine
+; various hacks, don't look :)
+ @ZLIB_SYMBOL_PREFIX@zng_deflateInit_
+ @ZLIB_SYMBOL_PREFIX@zng_deflateInit2_
+ @ZLIB_SYMBOL_PREFIX@zng_inflateInit_
+ @ZLIB_SYMBOL_PREFIX@zng_inflateInit2_
+ @ZLIB_SYMBOL_PREFIX@zng_inflateBackInit_
+ @ZLIB_SYMBOL_PREFIX@zng_zError
+ @ZLIB_SYMBOL_PREFIX@zng_inflateSyncPoint
+ @ZLIB_SYMBOL_PREFIX@zng_get_crc_table
+ @ZLIB_SYMBOL_PREFIX@zng_inflateUndermine
+ @ZLIB_SYMBOL_PREFIX@zng_inflateValidate
+ @ZLIB_SYMBOL_PREFIX@zng_inflateCodesUsed
+ @ZLIB_SYMBOL_PREFIX@zng_inflateResetKeep
+ @ZLIB_SYMBOL_PREFIX@zng_deflateResetKeep
#include <winver.h>
-#include "../zlib-ng.h"
+#include "zlib-ng.h"
#ifdef GCC_WINDRES
VS_VERSION_INFO VERSIONINFO
+++ /dev/null
-; zlib data compression library
-EXPORTS
-; basic functions
- zlibVersion
- deflate
- deflateEnd
- inflate
- inflateEnd
-; advanced functions
- deflateSetDictionary
- deflateGetDictionary
- deflateCopy
- deflateReset
- deflateParams
- deflateTune
- deflateBound
- deflatePending
- deflatePrime
- deflateSetHeader
- inflateSetDictionary
- inflateGetDictionary
- inflateSync
- inflateCopy
- inflateReset
- inflateReset2
- inflatePrime
- inflateMark
- inflateGetHeader
- inflateBack
- inflateBackEnd
- zlibCompileFlags
-; utility functions
- compress
- compress2
- compressBound
- uncompress
- uncompress2
-; large file functions
- adler32_combine64
- crc32_combine64
-; checksum functions
- adler32
- adler32_z
- crc32
- crc32_z
- adler32_combine
- crc32_combine
-; various hacks, don't look :)
- deflateInit_
- deflateInit2_
- inflateInit_
- inflateInit2_
- inflateBackInit_
- zError
- inflateSyncPoint
- get_crc_table
- inflateUndermine
- inflateValidate
- inflateCodesUsed
- inflateResetKeep
- deflateResetKeep
--- /dev/null
+; zlib data compression library
+EXPORTS
+; basic functions
+ @ZLIB_SYMBOL_PREFIX@zlibVersion
+ @ZLIB_SYMBOL_PREFIX@deflate
+ @ZLIB_SYMBOL_PREFIX@deflateEnd
+ @ZLIB_SYMBOL_PREFIX@inflate
+ @ZLIB_SYMBOL_PREFIX@inflateEnd
+; advanced functions
+ @ZLIB_SYMBOL_PREFIX@deflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@deflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@deflateCopy
+ @ZLIB_SYMBOL_PREFIX@deflateReset
+ @ZLIB_SYMBOL_PREFIX@deflateParams
+ @ZLIB_SYMBOL_PREFIX@deflateTune
+ @ZLIB_SYMBOL_PREFIX@deflateBound
+ @ZLIB_SYMBOL_PREFIX@deflatePending
+ @ZLIB_SYMBOL_PREFIX@deflatePrime
+ @ZLIB_SYMBOL_PREFIX@deflateSetHeader
+ @ZLIB_SYMBOL_PREFIX@inflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@inflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@inflateSync
+ @ZLIB_SYMBOL_PREFIX@inflateCopy
+ @ZLIB_SYMBOL_PREFIX@inflateReset
+ @ZLIB_SYMBOL_PREFIX@inflateReset2
+ @ZLIB_SYMBOL_PREFIX@inflatePrime
+ @ZLIB_SYMBOL_PREFIX@inflateMark
+ @ZLIB_SYMBOL_PREFIX@inflateGetHeader
+ @ZLIB_SYMBOL_PREFIX@inflateBack
+ @ZLIB_SYMBOL_PREFIX@inflateBackEnd
+ @ZLIB_SYMBOL_PREFIX@zlibCompileFlags
+; utility functions
+ @ZLIB_SYMBOL_PREFIX@compress
+ @ZLIB_SYMBOL_PREFIX@compress2
+ @ZLIB_SYMBOL_PREFIX@compressBound
+ @ZLIB_SYMBOL_PREFIX@uncompress
+ @ZLIB_SYMBOL_PREFIX@uncompress2
+; large file functions
+ @ZLIB_SYMBOL_PREFIX@adler32_combine64
+ @ZLIB_SYMBOL_PREFIX@crc32_combine64
+; checksum functions
+ @ZLIB_SYMBOL_PREFIX@adler32
+ @ZLIB_SYMBOL_PREFIX@adler32_z
+ @ZLIB_SYMBOL_PREFIX@crc32
+ @ZLIB_SYMBOL_PREFIX@crc32_z
+ @ZLIB_SYMBOL_PREFIX@adler32_combine
+ @ZLIB_SYMBOL_PREFIX@crc32_combine
+; various hacks, don't look :)
+ @ZLIB_SYMBOL_PREFIX@deflateInit_
+ @ZLIB_SYMBOL_PREFIX@deflateInit2_
+ @ZLIB_SYMBOL_PREFIX@inflateInit_
+ @ZLIB_SYMBOL_PREFIX@inflateInit2_
+ @ZLIB_SYMBOL_PREFIX@inflateBackInit_
+ @ZLIB_SYMBOL_PREFIX@zError
+ @ZLIB_SYMBOL_PREFIX@inflateSyncPoint
+ @ZLIB_SYMBOL_PREFIX@get_crc_table
+ @ZLIB_SYMBOL_PREFIX@inflateUndermine
+ @ZLIB_SYMBOL_PREFIX@inflateValidate
+ @ZLIB_SYMBOL_PREFIX@inflateCodesUsed
+ @ZLIB_SYMBOL_PREFIX@inflateResetKeep
+ @ZLIB_SYMBOL_PREFIX@deflateResetKeep
#include <winver.h>
-#include "../zlib.h"
+#include "zlib.h"
#ifdef GCC_WINDRES
VS_VERSION_INFO VERSIONINFO
+++ /dev/null
-; zlib data compression library
-EXPORTS
-; basic functions
- zlibVersion
- deflate
- deflateEnd
- inflate
- inflateEnd
-; advanced functions
- deflateSetDictionary
- deflateGetDictionary
- deflateCopy
- deflateReset
- deflateParams
- deflateTune
- deflateBound
- deflatePending
- deflatePrime
- deflateSetHeader
- inflateSetDictionary
- inflateGetDictionary
- inflateSync
- inflateCopy
- inflateReset
- inflateReset2
- inflatePrime
- inflateMark
- inflateGetHeader
- inflateBack
- inflateBackEnd
- zlibCompileFlags
-; utility functions
- compress
- compress2
- compressBound
- uncompress
- uncompress2
- gzopen
- gzdopen
- gzbuffer
- gzsetparams
- gzread
- gzfread
- gzwrite
- gzfwrite
- gzprintf
- gzvprintf
- gzputs
- gzgets
- gzputc
- gzgetc
- gzungetc
- gzflush
- gzseek
- gzrewind
- gztell
- gzoffset
- gzeof
- gzdirect
- gzclose
- gzclose_r
- gzclose_w
- gzerror
- gzclearerr
-; large file functions
- gzopen64
- gzseek64
- gztell64
- gzoffset64
- adler32_combine64
- crc32_combine64
-; checksum functions
- adler32
- adler32_z
- crc32
- crc32_z
- adler32_combine
- crc32_combine
-; various hacks, don't look :)
- deflateInit_
- deflateInit2_
- inflateInit_
- inflateInit2_
- inflateBackInit_
- gzgetc_
- zError
- inflateSyncPoint
- get_crc_table
- inflateUndermine
- inflateValidate
- inflateCodesUsed
- inflateResetKeep
- deflateResetKeep
- gzopen_w
--- /dev/null
+; zlib data compression library
+EXPORTS
+; basic functions
+ @ZLIB_SYMBOL_PREFIX@zlibVersion
+ @ZLIB_SYMBOL_PREFIX@deflate
+ @ZLIB_SYMBOL_PREFIX@deflateEnd
+ @ZLIB_SYMBOL_PREFIX@inflate
+ @ZLIB_SYMBOL_PREFIX@inflateEnd
+; advanced functions
+ @ZLIB_SYMBOL_PREFIX@deflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@deflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@deflateCopy
+ @ZLIB_SYMBOL_PREFIX@deflateReset
+ @ZLIB_SYMBOL_PREFIX@deflateParams
+ @ZLIB_SYMBOL_PREFIX@deflateTune
+ @ZLIB_SYMBOL_PREFIX@deflateBound
+ @ZLIB_SYMBOL_PREFIX@deflatePending
+ @ZLIB_SYMBOL_PREFIX@deflatePrime
+ @ZLIB_SYMBOL_PREFIX@deflateSetHeader
+ @ZLIB_SYMBOL_PREFIX@inflateSetDictionary
+ @ZLIB_SYMBOL_PREFIX@inflateGetDictionary
+ @ZLIB_SYMBOL_PREFIX@inflateSync
+ @ZLIB_SYMBOL_PREFIX@inflateCopy
+ @ZLIB_SYMBOL_PREFIX@inflateReset
+ @ZLIB_SYMBOL_PREFIX@inflateReset2
+ @ZLIB_SYMBOL_PREFIX@inflatePrime
+ @ZLIB_SYMBOL_PREFIX@inflateMark
+ @ZLIB_SYMBOL_PREFIX@inflateGetHeader
+ @ZLIB_SYMBOL_PREFIX@inflateBack
+ @ZLIB_SYMBOL_PREFIX@inflateBackEnd
+ @ZLIB_SYMBOL_PREFIX@zlibCompileFlags
+; utility functions
+ @ZLIB_SYMBOL_PREFIX@compress
+ @ZLIB_SYMBOL_PREFIX@compress2
+ @ZLIB_SYMBOL_PREFIX@compressBound
+ @ZLIB_SYMBOL_PREFIX@uncompress
+ @ZLIB_SYMBOL_PREFIX@uncompress2
+ @ZLIB_SYMBOL_PREFIX@gzopen
+ @ZLIB_SYMBOL_PREFIX@gzdopen
+ @ZLIB_SYMBOL_PREFIX@gzbuffer
+ @ZLIB_SYMBOL_PREFIX@gzsetparams
+ @ZLIB_SYMBOL_PREFIX@gzread
+ @ZLIB_SYMBOL_PREFIX@gzfread
+ @ZLIB_SYMBOL_PREFIX@gzwrite
+ @ZLIB_SYMBOL_PREFIX@gzfwrite
+ @ZLIB_SYMBOL_PREFIX@gzprintf
+ @ZLIB_SYMBOL_PREFIX@gzvprintf
+ @ZLIB_SYMBOL_PREFIX@gzputs
+ @ZLIB_SYMBOL_PREFIX@gzgets
+ @ZLIB_SYMBOL_PREFIX@gzputc
+ @ZLIB_SYMBOL_PREFIX@gzgetc
+ @ZLIB_SYMBOL_PREFIX@gzungetc
+ @ZLIB_SYMBOL_PREFIX@gzflush
+ @ZLIB_SYMBOL_PREFIX@gzseek
+ @ZLIB_SYMBOL_PREFIX@gzrewind
+ @ZLIB_SYMBOL_PREFIX@gztell
+ @ZLIB_SYMBOL_PREFIX@gzoffset
+ @ZLIB_SYMBOL_PREFIX@gzeof
+ @ZLIB_SYMBOL_PREFIX@gzdirect
+ @ZLIB_SYMBOL_PREFIX@gzclose
+ @ZLIB_SYMBOL_PREFIX@gzclose_r
+ @ZLIB_SYMBOL_PREFIX@gzclose_w
+ @ZLIB_SYMBOL_PREFIX@gzerror
+ @ZLIB_SYMBOL_PREFIX@gzclearerr
+; large file functions
+ @ZLIB_SYMBOL_PREFIX@gzopen64
+ @ZLIB_SYMBOL_PREFIX@gzseek64
+ @ZLIB_SYMBOL_PREFIX@gztell64
+ @ZLIB_SYMBOL_PREFIX@gzoffset64
+ @ZLIB_SYMBOL_PREFIX@adler32_combine64
+ @ZLIB_SYMBOL_PREFIX@crc32_combine64
+; checksum functions
+ @ZLIB_SYMBOL_PREFIX@adler32
+ @ZLIB_SYMBOL_PREFIX@adler32_z
+ @ZLIB_SYMBOL_PREFIX@crc32
+ @ZLIB_SYMBOL_PREFIX@crc32_z
+ @ZLIB_SYMBOL_PREFIX@adler32_combine
+ @ZLIB_SYMBOL_PREFIX@crc32_combine
+; various hacks, don't look :)
+ @ZLIB_SYMBOL_PREFIX@deflateInit_
+ @ZLIB_SYMBOL_PREFIX@deflateInit2_
+ @ZLIB_SYMBOL_PREFIX@inflateInit_
+ @ZLIB_SYMBOL_PREFIX@inflateInit2_
+ @ZLIB_SYMBOL_PREFIX@inflateBackInit_
+ @ZLIB_SYMBOL_PREFIX@gzgetc_
+ @ZLIB_SYMBOL_PREFIX@zError
+ @ZLIB_SYMBOL_PREFIX@inflateSyncPoint
+ @ZLIB_SYMBOL_PREFIX@get_crc_table
+ @ZLIB_SYMBOL_PREFIX@inflateUndermine
+ @ZLIB_SYMBOL_PREFIX@inflateValidate
+ @ZLIB_SYMBOL_PREFIX@inflateCodesUsed
+ @ZLIB_SYMBOL_PREFIX@inflateResetKeep
+ @ZLIB_SYMBOL_PREFIX@deflateResetKeep
+ @ZLIB_SYMBOL_PREFIX@gzopen_w
#ifndef ZCONFNG_H
#define ZCONFNG_H
+#include "zlib_name_mangling-ng.h"
+
#if !defined(_WIN32) && defined(__WIN32__)
# define _WIN32
#endif
#ifndef ZCONF_H
#define ZCONF_H
+#include "zlib_name_mangling.h"
+
#if !defined(_WIN32) && defined(__WIN32__)
# define _WIN32
#endif
Z_EXTERN Z_EXPORT int32_t zng_inflateBackInit_(zng_stream *strm, int32_t windowBits, uint8_t *window,
const char *version, int32_t stream_size);
-#define zng_deflateInit(strm, level) zng_deflateInit_((strm), (level), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
-#define zng_inflateInit(strm) zng_inflateInit_((strm), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
-#define zng_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+#define @ZLIB_SYMBOL_PREFIX@zng_deflateInit(strm, level) zng_deflateInit_((strm), (level), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
+#define @ZLIB_SYMBOL_PREFIX@zng_inflateInit(strm) zng_inflateInit_((strm), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
+#define @ZLIB_SYMBOL_PREFIX@zng_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
zng_deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \
(strategy), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
-#define zng_inflateInit2(strm, windowBits) zng_inflateInit2_((strm), (windowBits), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
-#define zng_inflateBackInit(strm, windowBits, window) \
+#define @ZLIB_SYMBOL_PREFIX@zng_inflateInit2(strm, windowBits) zng_inflateInit2_((strm), (windowBits), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
+#define @ZLIB_SYMBOL_PREFIX@zng_inflateBackInit(strm, windowBits, window) \
zng_inflateBackInit_((strm), (windowBits), (window), ZLIBNG_VERSION, (int32_t)sizeof(zng_stream))
#ifdef WITH_GZFILEOP
z_off64_t pos;
};
Z_EXTERN Z_EXPORT int32_t zng_gzgetc_(gzFile file); /* backward compatibility */
-# define zng_gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (zng_gzgetc)(g))
+# define @ZLIB_SYMBOL_PREFIX@zng_gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (@ZLIB_SYMBOL_PREFIX@zng_gzgetc)(g))
#endif /* WITH_GZFILEOP */
Z_EXTERN int Z_EXPORT inflateInit2_(z_stream *strm, int windowBits, const char *version, int stream_size);
Z_EXTERN int Z_EXPORT inflateBackInit_(z_stream *strm, int windowBits, unsigned char *window,
const char *version, int stream_size);
-#define deflateInit(strm, level) deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit(strm) inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+#define @ZLIB_SYMBOL_PREFIX@deflateInit(strm, level) deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+#define @ZLIB_SYMBOL_PREFIX@inflateInit(strm) inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+#define @ZLIB_SYMBOL_PREFIX@deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateInit2(strm, windowBits) inflateInit2_((strm), (windowBits), ZLIB_VERSION, (int)sizeof(z_stream))
-#define inflateBackInit(strm, windowBits, window) \
+#define @ZLIB_SYMBOL_PREFIX@inflateInit2(strm, windowBits) inflateInit2_((strm), (windowBits), ZLIB_VERSION, (int)sizeof(z_stream))
+#define @ZLIB_SYMBOL_PREFIX@inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), ZLIB_VERSION, (int)sizeof(z_stream))
z_off64_t pos;
};
Z_EXTERN int Z_EXPORT gzgetc_(gzFile file); /* backward compatibility */
-# define gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
+# define @ZLIB_SYMBOL_PREFIX@gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (@ZLIB_SYMBOL_PREFIX@gzgetc)(g))
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
#endif
#if !defined(Z_INTERNAL) && defined(Z_WANT64)
-# define gzopen gzopen64
-# define gzseek gzseek64
-# define gztell gztell64
-# define gzoffset gzoffset64
-# define adler32_combine adler32_combine64
-# define crc32_combine crc32_combine64
-# define crc32_combine_gen crc32_combine_gen64
+# define @ZLIB_SYMBOL_PREFIX@gzopen @ZLIB_SYMBOL_PREFIX@gzopen64
+# define @ZLIB_SYMBOL_PREFIX@gzseek @ZLIB_SYMBOL_PREFIX@gzseek64
+# define @ZLIB_SYMBOL_PREFIX@gztell @ZLIB_SYMBOL_PREFIX@gztell64
+# define @ZLIB_SYMBOL_PREFIX@gzoffset @ZLIB_SYMBOL_PREFIX@gzoffset64
+# define @ZLIB_SYMBOL_PREFIX@adler32_combine @ZLIB_SYMBOL_PREFIX@adler32_combine64
+# define @ZLIB_SYMBOL_PREFIX@crc32_combine @ZLIB_SYMBOL_PREFIX@crc32_combine64
+# define @ZLIB_SYMBOL_PREFIX@crc32_combine_gen @ZLIB_SYMBOL_PREFIX@crc32_combine_gen64
# ifndef Z_LARGE64
- Z_EXTERN gzFile Z_EXPORT gzopen64(const char *, const char *);
- Z_EXTERN z_off_t Z_EXPORT gzseek64(gzFile, z_off_t, int);
- Z_EXTERN z_off_t Z_EXPORT gztell64(gzFile);
- Z_EXTERN z_off_t Z_EXPORT gzoffset64(gzFile);
- Z_EXTERN unsigned long Z_EXPORT adler32_combine64(unsigned long, unsigned long, z_off_t);
- Z_EXTERN unsigned long Z_EXPORT crc32_combine64(unsigned long, unsigned long, z_off_t);
- Z_EXTERN void Z_EXPORT crc32_combine_gen64(uint32_t *op, z_off64_t);
+ Z_EXTERN gzFile Z_EXPORT @ZLIB_SYMBOL_PREFIX@gzopen64(const char *, const char *);
+ Z_EXTERN z_off_t Z_EXPORT @ZLIB_SYMBOL_PREFIX@gzseek64(gzFile, z_off_t, int);
+ Z_EXTERN z_off_t Z_EXPORT @ZLIB_SYMBOL_PREFIX@gztell64(gzFile);
+ Z_EXTERN z_off_t Z_EXPORT @ZLIB_SYMBOL_PREFIX@gzoffset64(gzFile);
+ Z_EXTERN unsigned long Z_EXPORT @ZLIB_SYMBOL_PREFIX@adler32_combine64(unsigned long, unsigned long, z_off_t);
+ Z_EXTERN unsigned long Z_EXPORT @ZLIB_SYMBOL_PREFIX@crc32_combine64(unsigned long, unsigned long, z_off_t);
+ Z_EXTERN void Z_EXPORT @ZLIB_SYMBOL_PREFIX@crc32_combine_gen64(uint32_t *op, z_off64_t);
# endif
#else
Z_EXTERN gzFile Z_EXPORT gzopen(const char *, const char *);
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
+symbol_prefix=@ZLIB_SYMBOL_PREFIX@
libdir=@PC_LIB_INSTALL_DIR@
sharedlibdir=${libdir}
includedir=@PC_INC_INSTALL_DIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
+symbol_prefix=@symbol_prefix@
libdir=@libdir@
sharedlibdir=@sharedlibdir@
includedir=@includedir@
--- /dev/null
+/* zlib_name_mangling.h has been automatically generated from
+ * zlib_name_mangling.h.in because ZLIB_SYMBOL_PREFIX was set.
+ */
+
+#ifndef ZLIB_NAME_MANGLING_H
+#define ZLIB_NAME_MANGLING_H
+
+/* all linked symbols and init macros */
+#define zng__dist_code @ZLIB_SYMBOL_PREFIX@zng__dist_code
+#define zng__length_code @ZLIB_SYMBOL_PREFIX@zng__length_code
+#define zng__tr_align @ZLIB_SYMBOL_PREFIX@zng__tr_align
+#define zng__tr_flush_bits @ZLIB_SYMBOL_PREFIX@zng__tr_flush_bits
+#define zng__tr_flush_block @ZLIB_SYMBOL_PREFIX@zng__tr_flush_block
+#define zng__tr_init @ZLIB_SYMBOL_PREFIX@zng__tr_init
+#define zng__tr_stored_block @ZLIB_SYMBOL_PREFIX@zng__tr_stored_block
+#define zng__tr_tally @ZLIB_SYMBOL_PREFIX@zng__tr_tally
+#define zng_adler32 @ZLIB_SYMBOL_PREFIX@zng_adler32
+#define zng_adler32_combine @ZLIB_SYMBOL_PREFIX@zng_adler32_combine
+#define zng_adler32_combine64 @ZLIB_SYMBOL_PREFIX@zng_adler32_combine64
+#define zng_adler32_z @ZLIB_SYMBOL_PREFIX@zng_adler32_z
+#ifndef Z_SOLO
+# define zng_compress @ZLIB_SYMBOL_PREFIX@zng_compress
+# define zng_compress2 @ZLIB_SYMBOL_PREFIX@zng_compress2
+# define zng_compressBound @ZLIB_SYMBOL_PREFIX@zng_compressBound
+#endif
+#define zng_crc32 @ZLIB_SYMBOL_PREFIX@zng_crc32
+#define zng_crc32_combine @ZLIB_SYMBOL_PREFIX@zng_crc32_combine
+#define zng_crc32_combine64 @ZLIB_SYMBOL_PREFIX@zng_crc32_combine64
+#define zng_crc32_z @ZLIB_SYMBOL_PREFIX@zng_crc32_z
+#define zng_deflate @ZLIB_SYMBOL_PREFIX@zng_deflate
+#define zng_deflateBound @ZLIB_SYMBOL_PREFIX@zng_deflateBound
+#define zng_deflateCopy @ZLIB_SYMBOL_PREFIX@zng_deflateCopy
+#define zng_deflateEnd @ZLIB_SYMBOL_PREFIX@zng_deflateEnd
+#define zng_deflateGetDictionary @ZLIB_SYMBOL_PREFIX@zng_deflateGetDictionary
+#define zng_deflateInit @ZLIB_SYMBOL_PREFIX@zng_deflateInit
+#define zng_deflateInit2 @ZLIB_SYMBOL_PREFIX@zng_deflateInit2
+#define zng_deflateInit2_ @ZLIB_SYMBOL_PREFIX@zng_deflateInit2_
+#define zng_deflateInit_ @ZLIB_SYMBOL_PREFIX@zng_deflateInit_
+#define zng_deflateParams @ZLIB_SYMBOL_PREFIX@zng_deflateParams
+#define zng_deflatePending @ZLIB_SYMBOL_PREFIX@zng_deflatePending
+#define zng_deflatePrime @ZLIB_SYMBOL_PREFIX@zng_deflatePrime
+#define zng_deflateReset @ZLIB_SYMBOL_PREFIX@zng_deflateReset
+#define zng_deflateResetKeep @ZLIB_SYMBOL_PREFIX@zng_deflateResetKeep
+#define zng_deflateSetDictionary @ZLIB_SYMBOL_PREFIX@zng_deflateSetDictionary
+#define zng_deflateSetHeader @ZLIB_SYMBOL_PREFIX@zng_deflateSetHeader
+#define zng_deflateTune @ZLIB_SYMBOL_PREFIX@zng_deflateTune
+#define zng_deflate_copyright @ZLIB_SYMBOL_PREFIX@zng_deflate_copyright
+#define zng_get_crc_table @ZLIB_SYMBOL_PREFIX@zng_get_crc_table
+#ifndef Z_SOLO
+# define zng_gz_error @ZLIB_SYMBOL_PREFIX@zng_gz_error
+# define zng_gz_intmax @ZLIB_SYMBOL_PREFIX@zng_gz_intmax
+# define zng_gz_strwinerror @ZLIB_SYMBOL_PREFIX@zng_gz_strwinerror
+# define zng_gzbuffer @ZLIB_SYMBOL_PREFIX@zng_gzbuffer
+# define zng_gzclearerr @ZLIB_SYMBOL_PREFIX@zng_gzclearerr
+# define zng_gzclose @ZLIB_SYMBOL_PREFIX@zng_gzclose
+# define zng_gzclose_r @ZLIB_SYMBOL_PREFIX@zng_gzclose_r
+# define zng_gzclose_w @ZLIB_SYMBOL_PREFIX@zng_gzclose_w
+# define zng_gzdirect @ZLIB_SYMBOL_PREFIX@zng_gzdirect
+# define zng_gzdopen @ZLIB_SYMBOL_PREFIX@zng_gzdopen
+# define zng_gzeof @ZLIB_SYMBOL_PREFIX@zng_gzeof
+# define zng_gzerror @ZLIB_SYMBOL_PREFIX@zng_gzerror
+# define zng_gzflush @ZLIB_SYMBOL_PREFIX@zng_gzflush
+# define zng_gzfread @ZLIB_SYMBOL_PREFIX@zng_gzfread
+# define zng_gzfwrite @ZLIB_SYMBOL_PREFIX@zng_gzfwrite
+# define zng_gzgetc @ZLIB_SYMBOL_PREFIX@zng_gzgetc
+# define zng_gzgetc_ @ZLIB_SYMBOL_PREFIX@zng_gzgetc_
+# define zng_gzgets @ZLIB_SYMBOL_PREFIX@zng_gzgets
+# define zng_gzoffset @ZLIB_SYMBOL_PREFIX@zng_gzoffset
+# define zng_gzoffset64 @ZLIB_SYMBOL_PREFIX@zng_gzoffset64
+# define zng_gzopen @ZLIB_SYMBOL_PREFIX@zng_gzopen
+# define zng_gzopen64 @ZLIB_SYMBOL_PREFIX@zng_gzopen64
+# ifdef _WIN32
+# define zng_gzopen_w @ZLIB_SYMBOL_PREFIX@zng_gzopen_w
+# endif
+# define zng_gzprintf @ZLIB_SYMBOL_PREFIX@zng_gzprintf
+# define zng_gzputc @ZLIB_SYMBOL_PREFIX@zng_gzputc
+# define zng_gzputs @ZLIB_SYMBOL_PREFIX@zng_gzputs
+# define zng_gzread @ZLIB_SYMBOL_PREFIX@zng_gzread
+# define zng_gzrewind @ZLIB_SYMBOL_PREFIX@zng_gzrewind
+# define zng_gzseek @ZLIB_SYMBOL_PREFIX@zng_gzseek
+# define zng_gzseek64 @ZLIB_SYMBOL_PREFIX@zng_gzseek64
+# define zng_gzsetparams @ZLIB_SYMBOL_PREFIX@zng_gzsetparams
+# define zng_gztell @ZLIB_SYMBOL_PREFIX@zng_gztell
+# define zng_gztell64 @ZLIB_SYMBOL_PREFIX@zng_gztell64
+# define zng_gzungetc @ZLIB_SYMBOL_PREFIX@zng_gzungetc
+# define zng_gzvprintf @ZLIB_SYMBOL_PREFIX@zng_gzvprintf
+# define zng_gzwrite @ZLIB_SYMBOL_PREFIX@zng_gzwrite
+#endif
+#define zng_inflate @ZLIB_SYMBOL_PREFIX@zng_inflate
+#define zng_inflateBack @ZLIB_SYMBOL_PREFIX@zng_inflateBack
+#define zng_inflateBackEnd @ZLIB_SYMBOL_PREFIX@zng_inflateBackEnd
+#define zng_inflateBackInit @ZLIB_SYMBOL_PREFIX@zng_inflateBackInit
+#define zng_inflateBackInit_ @ZLIB_SYMBOL_PREFIX@zng_inflateBackInit_
+#define zng_inflateCodesUsed @ZLIB_SYMBOL_PREFIX@zng_inflateCodesUsed
+#define zng_inflateCopy @ZLIB_SYMBOL_PREFIX@zng_inflateCopy
+#define zng_inflateEnd @ZLIB_SYMBOL_PREFIX@zng_inflateEnd
+#define zng_inflateGetDictionary @ZLIB_SYMBOL_PREFIX@zng_inflateGetDictionary
+#define zng_inflateGetHeader @ZLIB_SYMBOL_PREFIX@zng_inflateGetHeader
+#define zng_inflateInit @ZLIB_SYMBOL_PREFIX@zng_inflateInit
+#define zng_inflateInit2 @ZLIB_SYMBOL_PREFIX@zng_inflateInit2
+#define zng_inflateInit2_ @ZLIB_SYMBOL_PREFIX@zng_inflateInit2_
+#define zng_inflateInit_ @ZLIB_SYMBOL_PREFIX@zng_inflateInit_
+#define zng_inflateMark @ZLIB_SYMBOL_PREFIX@zng_inflateMark
+#define zng_inflatePrime @ZLIB_SYMBOL_PREFIX@zng_inflatePrime
+#define zng_inflateReset @ZLIB_SYMBOL_PREFIX@zng_inflateReset
+#define zng_inflateReset2 @ZLIB_SYMBOL_PREFIX@zng_inflateReset2
+#define zng_inflateResetKeep @ZLIB_SYMBOL_PREFIX@zng_inflateResetKeep
+#define zng_inflateSetDictionary @ZLIB_SYMBOL_PREFIX@zng_inflateSetDictionary
+#define zng_inflateSync @ZLIB_SYMBOL_PREFIX@zng_inflateSync
+#define zng_inflateSyncPoint @ZLIB_SYMBOL_PREFIX@zng_inflateSyncPoint
+#define zng_inflateUndermine @ZLIB_SYMBOL_PREFIX@zng_inflateUndermine
+#define zng_inflateValidate @ZLIB_SYMBOL_PREFIX@zng_inflateValidate
+#define zng_inflate_copyright @ZLIB_SYMBOL_PREFIX@zng_inflate_copyright
+#define zng_inflate_fast @ZLIB_SYMBOL_PREFIX@zng_inflate_fast
+#define zng_inflate_table @ZLIB_SYMBOL_PREFIX@zng_inflate_table
+#ifndef Z_SOLO
+# define zng_uncompress @ZLIB_SYMBOL_PREFIX@zng_uncompress
+# define zng_uncompress2 @ZLIB_SYMBOL_PREFIX@zng_uncompress2
+#endif
+#define zng_zError @ZLIB_SYMBOL_PREFIX@zng_zError
+#ifndef Z_SOLO
+# define zng_zcalloc @ZLIB_SYMBOL_PREFIX@zng_zcalloc
+# define zng_zcfree @ZLIB_SYMBOL_PREFIX@zng_zcfree
+#endif
+#define zng_zlibCompileFlags @ZLIB_SYMBOL_PREFIX@zng_zlibCompileFlags
+#define zng_zlibVersion @ZLIB_SYMBOL_PREFIX@zng_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#define Byte @ZLIB_SYMBOL_PREFIX@Byte
+#define Bytef @ZLIB_SYMBOL_PREFIX@Bytef
+#define alloc_func @ZLIB_SYMBOL_PREFIX@alloc_func
+#define charf @ZLIB_SYMBOL_PREFIX@charf
+#define free_func @ZLIB_SYMBOL_PREFIX@free_func
+#ifndef Z_SOLO
+# define gzFile @ZLIB_SYMBOL_PREFIX@gzFile
+#endif
+#define gz_header @ZLIB_SYMBOL_PREFIX@gz_header
+#define gz_headerp @ZLIB_SYMBOL_PREFIX@gz_headerp
+#define in_func @ZLIB_SYMBOL_PREFIX@in_func
+#define intf @ZLIB_SYMBOL_PREFIX@intf
+#define out_func @ZLIB_SYMBOL_PREFIX@out_func
+#define uInt @ZLIB_SYMBOL_PREFIX@uInt
+#define uIntf @ZLIB_SYMBOL_PREFIX@uIntf
+#define uLong @ZLIB_SYMBOL_PREFIX@uLong
+#define uLongf @ZLIB_SYMBOL_PREFIX@uLongf
+#define voidp @ZLIB_SYMBOL_PREFIX@voidp
+#define voidpc @ZLIB_SYMBOL_PREFIX@voidpc
+#define voidpf @ZLIB_SYMBOL_PREFIX@voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#define zng_gz_header_s @ZLIB_SYMBOL_PREFIX@zng_gz_header_s
+#define internal_state @ZLIB_SYMBOL_PREFIX@internal_state
+
+/* zlib-ng specific symbols */
+#define zng_deflate_param @ZLIB_SYMBOL_PREFIX@zng_deflate_param
+#define zng_deflate_param_value @ZLIB_SYMBOL_PREFIX@zng_deflate_param_value
+#define zng_deflateSetParams @ZLIB_SYMBOL_PREFIX@zng_deflateSetParams
+#define zng_deflateGetParams @ZLIB_SYMBOL_PREFIX@zng_deflateGetParams
+
+#define zlibng_version @ZLIB_SYMBOL_PREFIX@zlibng_version
+#define zng_zError @ZLIB_SYMBOL_PREFIX@zng_zError
+#define zng_inflateSyncPoint @ZLIB_SYMBOL_PREFIX@zng_inflateSyncPoint
+#define zng_get_crc_table @ZLIB_SYMBOL_PREFIX@zng_get_crc_table
+#define zng_inflateUndermine @ZLIB_SYMBOL_PREFIX@zng_inflateUndermine
+#define zng_inflateValidate @ZLIB_SYMBOL_PREFIX@zng_inflateValidate
+#define zng_inflateCodesUsed @ZLIB_SYMBOL_PREFIX@zng_inflateCodesUsed
+#define zng_inflateResetKeep @ZLIB_SYMBOL_PREFIX@zng_inflateResetKeep
+#define zng_deflateResetKeep @ZLIB_SYMBOL_PREFIX@zng_deflateResetKeep
+
+#define zng_gzopen_w @ZLIB_SYMBOL_PREFIX@zng_gzopen_w
+#define zng_gzvprintf @ZLIB_SYMBOL_PREFIX@zng_gzvprintf
+
+#endif /* ZLIB_NAME_MANGLING_H */
--- /dev/null
+/* zlib_name_mangling.h has been automatically generated from
+ * zlib_name_mangling.h.empty because ZLIB_SYMBOL_PREFIX was NOT set.
+ */
+
+#ifndef ZLIB_NAME_MANGLING_H
+#define ZLIB_NAME_MANGLING_H
+
+#endif /* ZLIB_NAME_MANGLING_H */
--- /dev/null
+/* zlib_name_mangling.h has been automatically generated from
+ * zlib_name_mangling.h.in because ZLIB_SYMBOL_PREFIX was set.
+ */
+
+#ifndef ZLIB_NAME_MANGLING_H
+#define ZLIB_NAME_MANGLING_H
+
+/* all linked symbols and init macros */
+#define _dist_code @ZLIB_SYMBOL_PREFIX@_dist_code
+#define _length_code @ZLIB_SYMBOL_PREFIX@_length_code
+#define _tr_align @ZLIB_SYMBOL_PREFIX@_tr_align
+#define _tr_flush_bits @ZLIB_SYMBOL_PREFIX@_tr_flush_bits
+#define _tr_flush_block @ZLIB_SYMBOL_PREFIX@_tr_flush_block
+#define _tr_init @ZLIB_SYMBOL_PREFIX@_tr_init
+#define _tr_stored_block @ZLIB_SYMBOL_PREFIX@_tr_stored_block
+#define _tr_tally @ZLIB_SYMBOL_PREFIX@_tr_tally
+#define adler32 @ZLIB_SYMBOL_PREFIX@adler32
+#define adler32_combine @ZLIB_SYMBOL_PREFIX@adler32_combine
+#define adler32_combine64 @ZLIB_SYMBOL_PREFIX@adler32_combine64
+#define adler32_z @ZLIB_SYMBOL_PREFIX@adler32_z
+#ifndef Z_SOLO
+# define compress @ZLIB_SYMBOL_PREFIX@compress
+# define compress2 @ZLIB_SYMBOL_PREFIX@compress2
+# define compressBound @ZLIB_SYMBOL_PREFIX@compressBound
+#endif
+#define crc32 @ZLIB_SYMBOL_PREFIX@crc32
+#define crc32_combine @ZLIB_SYMBOL_PREFIX@crc32_combine
+#define crc32_combine64 @ZLIB_SYMBOL_PREFIX@crc32_combine64
+#define crc32_z @ZLIB_SYMBOL_PREFIX@crc32_z
+#define deflate @ZLIB_SYMBOL_PREFIX@deflate
+#define deflateBound @ZLIB_SYMBOL_PREFIX@deflateBound
+#define deflateCopy @ZLIB_SYMBOL_PREFIX@deflateCopy
+#define deflateEnd @ZLIB_SYMBOL_PREFIX@deflateEnd
+#define deflateGetDictionary @ZLIB_SYMBOL_PREFIX@deflateGetDictionary
+#define deflateInit @ZLIB_SYMBOL_PREFIX@deflateInit
+#define deflateInit2 @ZLIB_SYMBOL_PREFIX@deflateInit2
+#define deflateInit2_ @ZLIB_SYMBOL_PREFIX@deflateInit2_
+#define deflateInit_ @ZLIB_SYMBOL_PREFIX@deflateInit_
+#define deflateParams @ZLIB_SYMBOL_PREFIX@deflateParams
+#define deflatePending @ZLIB_SYMBOL_PREFIX@deflatePending
+#define deflatePrime @ZLIB_SYMBOL_PREFIX@deflatePrime
+#define deflateReset @ZLIB_SYMBOL_PREFIX@deflateReset
+#define deflateResetKeep @ZLIB_SYMBOL_PREFIX@deflateResetKeep
+#define deflateSetDictionary @ZLIB_SYMBOL_PREFIX@deflateSetDictionary
+#define deflateSetHeader @ZLIB_SYMBOL_PREFIX@deflateSetHeader
+#define deflateTune @ZLIB_SYMBOL_PREFIX@deflateTune
+#define deflate_copyright @ZLIB_SYMBOL_PREFIX@deflate_copyright
+#define get_crc_table @ZLIB_SYMBOL_PREFIX@get_crc_table
+#ifndef Z_SOLO
+# define gz_error @ZLIB_SYMBOL_PREFIX@gz_error
+# define gz_intmax @ZLIB_SYMBOL_PREFIX@gz_intmax
+# define gz_strwinerror @ZLIB_SYMBOL_PREFIX@gz_strwinerror
+# define gzbuffer @ZLIB_SYMBOL_PREFIX@gzbuffer
+# define gzclearerr @ZLIB_SYMBOL_PREFIX@gzclearerr
+# define gzclose @ZLIB_SYMBOL_PREFIX@gzclose
+# define gzclose_r @ZLIB_SYMBOL_PREFIX@gzclose_r
+# define gzclose_w @ZLIB_SYMBOL_PREFIX@gzclose_w
+# define gzdirect @ZLIB_SYMBOL_PREFIX@gzdirect
+# define gzdopen @ZLIB_SYMBOL_PREFIX@gzdopen
+# define gzeof @ZLIB_SYMBOL_PREFIX@gzeof
+# define gzerror @ZLIB_SYMBOL_PREFIX@gzerror
+# define gzflush @ZLIB_SYMBOL_PREFIX@gzflush
+# define gzfread @ZLIB_SYMBOL_PREFIX@gzfread
+# define gzfwrite @ZLIB_SYMBOL_PREFIX@gzfwrite
+# define gzgetc @ZLIB_SYMBOL_PREFIX@gzgetc
+# define gzgetc_ @ZLIB_SYMBOL_PREFIX@gzgetc_
+# define gzgets @ZLIB_SYMBOL_PREFIX@gzgets
+# define gzoffset @ZLIB_SYMBOL_PREFIX@gzoffset
+# define gzoffset64 @ZLIB_SYMBOL_PREFIX@gzoffset64
+# define gzopen @ZLIB_SYMBOL_PREFIX@gzopen
+# define gzopen64 @ZLIB_SYMBOL_PREFIX@gzopen64
+# ifdef _WIN32
+# define gzopen_w @ZLIB_SYMBOL_PREFIX@gzopen_w
+# endif
+# define gzprintf @ZLIB_SYMBOL_PREFIX@gzprintf
+# define gzputc @ZLIB_SYMBOL_PREFIX@gzputc
+# define gzputs @ZLIB_SYMBOL_PREFIX@gzputs
+# define gzread @ZLIB_SYMBOL_PREFIX@gzread
+# define gzrewind @ZLIB_SYMBOL_PREFIX@gzrewind
+# define gzseek @ZLIB_SYMBOL_PREFIX@gzseek
+# define gzseek64 @ZLIB_SYMBOL_PREFIX@gzseek64
+# define gzsetparams @ZLIB_SYMBOL_PREFIX@gzsetparams
+# define gztell @ZLIB_SYMBOL_PREFIX@gztell
+# define gztell64 @ZLIB_SYMBOL_PREFIX@gztell64
+# define gzungetc @ZLIB_SYMBOL_PREFIX@gzungetc
+# define gzvprintf @ZLIB_SYMBOL_PREFIX@gzvprintf
+# define gzwrite @ZLIB_SYMBOL_PREFIX@gzwrite
+#endif
+#define inflate @ZLIB_SYMBOL_PREFIX@inflate
+#define inflateBack @ZLIB_SYMBOL_PREFIX@inflateBack
+#define inflateBackEnd @ZLIB_SYMBOL_PREFIX@inflateBackEnd
+#define inflateBackInit @ZLIB_SYMBOL_PREFIX@inflateBackInit
+#define inflateBackInit_ @ZLIB_SYMBOL_PREFIX@inflateBackInit_
+#define inflateCodesUsed @ZLIB_SYMBOL_PREFIX@inflateCodesUsed
+#define inflateCopy @ZLIB_SYMBOL_PREFIX@inflateCopy
+#define inflateEnd @ZLIB_SYMBOL_PREFIX@inflateEnd
+#define inflateGetDictionary @ZLIB_SYMBOL_PREFIX@inflateGetDictionary
+#define inflateGetHeader @ZLIB_SYMBOL_PREFIX@inflateGetHeader
+#define inflateInit @ZLIB_SYMBOL_PREFIX@inflateInit
+#define inflateInit2 @ZLIB_SYMBOL_PREFIX@inflateInit2
+#define inflateInit2_ @ZLIB_SYMBOL_PREFIX@inflateInit2_
+#define inflateInit_ @ZLIB_SYMBOL_PREFIX@inflateInit_
+#define inflateMark @ZLIB_SYMBOL_PREFIX@inflateMark
+#define inflatePrime @ZLIB_SYMBOL_PREFIX@inflatePrime
+#define inflateReset @ZLIB_SYMBOL_PREFIX@inflateReset
+#define inflateReset2 @ZLIB_SYMBOL_PREFIX@inflateReset2
+#define inflateResetKeep @ZLIB_SYMBOL_PREFIX@inflateResetKeep
+#define inflateSetDictionary @ZLIB_SYMBOL_PREFIX@inflateSetDictionary
+#define inflateSync @ZLIB_SYMBOL_PREFIX@inflateSync
+#define inflateSyncPoint @ZLIB_SYMBOL_PREFIX@inflateSyncPoint
+#define inflateUndermine @ZLIB_SYMBOL_PREFIX@inflateUndermine
+#define inflateValidate @ZLIB_SYMBOL_PREFIX@inflateValidate
+#define inflate_copyright @ZLIB_SYMBOL_PREFIX@inflate_copyright
+#define inflate_fast @ZLIB_SYMBOL_PREFIX@inflate_fast
+#define inflate_table @ZLIB_SYMBOL_PREFIX@inflate_table
+#ifndef Z_SOLO
+# define uncompress @ZLIB_SYMBOL_PREFIX@uncompress
+# define uncompress2 @ZLIB_SYMBOL_PREFIX@uncompress2
+#endif
+#define zError @ZLIB_SYMBOL_PREFIX@zError
+#ifndef Z_SOLO
+# define zcalloc @ZLIB_SYMBOL_PREFIX@zcalloc
+# define zcfree @ZLIB_SYMBOL_PREFIX@zcfree
+#endif
+#define zlibCompileFlags @ZLIB_SYMBOL_PREFIX@zlibCompileFlags
+#define zlibVersion @ZLIB_SYMBOL_PREFIX@zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+#define Byte @ZLIB_SYMBOL_PREFIX@Byte
+#define Bytef @ZLIB_SYMBOL_PREFIX@Bytef
+#define alloc_func @ZLIB_SYMBOL_PREFIX@alloc_func
+#define charf @ZLIB_SYMBOL_PREFIX@charf
+#define free_func @ZLIB_SYMBOL_PREFIX@free_func
+#ifndef Z_SOLO
+# define gzFile @ZLIB_SYMBOL_PREFIX@gzFile
+#endif
+#define gz_header @ZLIB_SYMBOL_PREFIX@gz_header
+#define gz_headerp @ZLIB_SYMBOL_PREFIX@gz_headerp
+#define in_func @ZLIB_SYMBOL_PREFIX@in_func
+#define intf @ZLIB_SYMBOL_PREFIX@intf
+#define out_func @ZLIB_SYMBOL_PREFIX@out_func
+#define uInt @ZLIB_SYMBOL_PREFIX@uInt
+#define uIntf @ZLIB_SYMBOL_PREFIX@uIntf
+#define uLong @ZLIB_SYMBOL_PREFIX@uLong
+#define uLongf @ZLIB_SYMBOL_PREFIX@uLongf
+#define voidp @ZLIB_SYMBOL_PREFIX@voidp
+#define voidpc @ZLIB_SYMBOL_PREFIX@voidpc
+#define voidpf @ZLIB_SYMBOL_PREFIX@voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+#define gz_header_s @ZLIB_SYMBOL_PREFIX@gz_header_s
+#define internal_state @ZLIB_SYMBOL_PREFIX@internal_state
+
+/* all zlib structs in zutil.h */
+#define z_errmsg @ZLIB_SYMBOL_PREFIX@z_errmsg
+
+#endif /* ZLIB_NAME_MANGLING_H */