summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoazin Khatti <moazinkhatri@gmail.com>2019-08-05 11:51:58 +0500
committerMoazin Khatti <moazinkhatri@gmail.com>2019-08-05 11:51:58 +0500
commit3081146633ec14feeb4cc85faa9f4eed6fc6b0a5 (patch)
tree97d3f3b85c871c17b631f6ea8cc5b1212064b44f
parent545869da731536b0cf677a5eadeeca58fb01bd62 (diff)
downloadfreetype2-internal-zlib-update.tar.gz
Improve the internal zlib.internal-zlib-update
* Change stdlib calls to FT internal ones. * Change config file from `zconf.h' to `ftzconf.h'
-rw-r--r--src/gzip/ftgzip.c4
-rw-r--r--src/gzip/ftzconf.h (renamed from src/gzip/zconf.h)0
-rw-r--r--src/gzip/rules.mk2
-rw-r--r--src/gzip/zlib.h2
-rw-r--r--src/gzip/zutil.h12
5 files changed, 9 insertions, 11 deletions
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index 9fabb6934..8de1d4b38 100644
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -55,7 +55,7 @@
/* original ZLib. */
#ifndef USE_ZLIB_ZCALLOC
-/* #define MY_ZCALLOC */ /* prevent all zcalloc() & zfree() in zutil.c */
+ #define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutil.c */
#endif
/* Note that our `zlib.h' includes `ftzconf.h' instead of `zconf.h'; */
@@ -165,7 +165,6 @@
#if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC )
-/*
local voidpf
zcalloc ( voidpf opaque,
unsigned items,
@@ -181,7 +180,6 @@
ft_gzip_free( (FT_Memory)opaque, ptr );
}
-*/
#endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */
diff --git a/src/gzip/zconf.h b/src/gzip/ftzconf.h
index 77398c11a..77398c11a 100644
--- a/src/gzip/zconf.h
+++ b/src/gzip/ftzconf.h
diff --git a/src/gzip/rules.mk b/src/gzip/rules.mk
index e10217a02..512d51ea6 100644
--- a/src/gzip/rules.mk
+++ b/src/gzip/rules.mk
@@ -43,7 +43,7 @@ GZIP_DRV_SRCS := $(GZIP_DIR)/inftrees.c \
$(GZIP_DIR)/gzread.c \
$(GZIP_DIR)/inftrees.h \
$(GZIP_DIR)/deflate.c \
- $(GZIP_DIR)/zconf.h \
+ $(GZIP_DIR)/ftzconf.h \
$(GZIP_DIR)/trees.c \
$(GZIP_DIR)/inffast.c \
$(GZIP_DIR)/inflate.c \
diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
index f09cdaf1e..e91a3ca3d 100644
--- a/src/gzip/zlib.h
+++ b/src/gzip/zlib.h
@@ -31,7 +31,7 @@
#ifndef ZLIB_H
#define ZLIB_H
-#include "zconf.h"
+#include "ftzconf.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
index b079ea6a8..f35b7cafb 100644
--- a/src/gzip/zutil.h
+++ b/src/gzip/zutil.h
@@ -106,7 +106,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#if defined(VAXC) || defined(VMS)
# define OS_CODE 2
# define F_OPEN(name, mode) \
- fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+ ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
#ifdef __370__
@@ -223,9 +223,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len)
# else
-# define zmemcpy memcpy
-# define zmemcmp memcmp
-# define zmemzero(dest, len) memset(dest, 0, len)
+# define zmemcpy ft_memcpy
+# define zmemcmp ft_memcmp
+# define zmemzero(dest, len) ft_memset(dest, 0, len)
# endif
#else
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
@@ -254,9 +254,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
#ifndef Z_SOLO
- voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+ static voidpf zcalloc OF((voidpf opaque, unsigned items,
unsigned size));
- void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
+ static void zcfree OF((voidpf opaque, voidpf ptr));
#endif
#define ZALLOC(strm, items, size) \