summaryrefslogtreecommitdiff
path: root/uncompr.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 /uncompr.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 'uncompr.c')
-rw-r--r--uncompr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/uncompr.c b/uncompr.c
index 7bf47b8..9214005 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -24,7 +24,7 @@
Z_DATA_ERROR if the input data was corrupted, including if the input data is
an incomplete zlib stream.
*/
-int ZEXPORT uncompress2(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t *sourceLen) {
+int ZEXPORT PREFIX(uncompress2)(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t *sourceLen) {
z_stream stream;
int err;
const unsigned int max = (unsigned int)-1;
@@ -78,7 +78,7 @@ int ZEXPORT uncompress2(unsigned char *dest, size_t *destLen, const unsigned cha
err;
}
-int ZEXPORT uncompress(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t sourceLen)
+int ZEXPORT PREFIX(uncompress)(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t sourceLen)
{
return uncompress2(dest, destLen, source, &sourceLen);
}