summaryrefslogtreecommitdiff
path: root/zutil.c
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2018-01-31 10:24:35 +0100
committerHans Kristian Rosbach <hk-git@circlestorm.org>2018-01-31 10:45:29 +0100
commitf5e888a6a6763da6570c95eac78f1436b6d78494 (patch)
treee109b39712572ed03f9a3f8484df1d73931ef86a /zutil.c
parentdfdb082b2fd190b7d3a1cec966cf8c82d0e98458 (diff)
Add function prefix (zng_) to all exported functions to allow zlib-ng
to co-exist in an application that has been linked to something that depends on stock zlib. Previously, that would cause random problems since there is no way to guarantee what zlib version is being used for each dynamically linked function. Add the corresponding zlib-ng.h. Tests, example and minigzip will not compile before they have been adapted to use the correct functions as well. Either duplicate them, so we have minigzip-ng.c for example, or add compile-time detection in the source code.
Diffstat (limited to 'zutil.c')
-rw-r--r--zutil.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/zutil.c b/zutil.c
index 6df7abf..049454d 100644
--- a/zutil.c
+++ b/zutil.c
@@ -31,7 +31,12 @@ const char * ZEXPORT zlibVersion(void)
return ZLIB_VERSION;
}
-unsigned long ZEXPORT zlibCompileFlags(void)
+const char * ZEXPORT zlibng_version(void)
+{
+ return ZLIBNG_VERSION;
+}
+
+unsigned long ZEXPORT PREFIX(zlibCompileFlags)(void)
{
unsigned long flags;
@@ -102,7 +107,7 @@ void ZLIB_INTERNAL z_error (m)
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
-const char * ZEXPORT zError(int err)
+const char * ZEXPORT PREFIX(zError)(int err)
{
return ERR_MSG(err);
}