diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2018-01-31 10:24:35 +0100 |
---|---|---|
committer | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2018-01-31 10:45:29 +0100 |
commit | f5e888a6a6763da6570c95eac78f1436b6d78494 (patch) | |
tree | e109b39712572ed03f9a3f8484df1d73931ef86a /gzwrite.c | |
parent | dfdb082b2fd190b7d3a1cec966cf8c82d0e98458 (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 'gzwrite.c')
-rw-r--r-- | gzwrite.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -220,7 +220,7 @@ static size_t gz_write(gz_state *state, void const *buf, size_t len) { } /* -- see zlib.h -- */ -int ZEXPORT gzwrite(gzFile file, void const *buf, unsigned len) { +int ZEXPORT PREFIX(gzwrite)(gzFile file, void const *buf, unsigned len) { gz_state *state; /* get internal structure */ @@ -244,7 +244,7 @@ int ZEXPORT gzwrite(gzFile file, void const *buf, unsigned len) { } /* -- see zlib.h -- */ -size_t ZEXPORT gzfwrite(void const *buf, size_t size, size_t nitems, gzFile file) { +size_t ZEXPORT PREFIX(gzfwrite)(void const *buf, size_t size, size_t nitems, gzFile file) { size_t len; gz_state *state; @@ -273,7 +273,7 @@ size_t ZEXPORT gzfwrite(void const *buf, size_t size, size_t nitems, gzFile file } /* -- see zlib.h -- */ -int ZEXPORT gzputc(gzFile file, int c) { +int ZEXPORT PREFIX(gzputc)(gzFile file, int c) { unsigned have; unsigned char buf[1]; gz_state *state; @@ -318,7 +318,7 @@ int ZEXPORT gzputc(gzFile file, int c) { } /* -- see zlib.h -- */ -int ZEXPORT gzputs(gzFile file, const char *str) { +int ZEXPORT PREFIX(gzputs)(gzFile file, const char *str) { int ret; size_t len; gz_state *state; @@ -339,7 +339,7 @@ int ZEXPORT gzputs(gzFile file, const char *str) { } /* -- see zlib.h -- */ -int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { +int ZEXPORTVA PREFIX(gzvprintf)(gzFile file, const char *format, va_list va) { int len; unsigned left; char *next; @@ -395,7 +395,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { return len; } -int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) { +int ZEXPORTVA PREFIX(gzprintf)(gzFile file, const char *format, ...) { va_list va; int ret; @@ -406,7 +406,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) { } /* -- see zlib.h -- */ -int ZEXPORT gzflush(gzFile file, int flush) { +int ZEXPORT PREFIX(gzflush)(gzFile file, int flush) { gz_state *state; /* get internal structure */ @@ -435,7 +435,7 @@ int ZEXPORT gzflush(gzFile file, int flush) { } /* -- see zlib.h -- */ -int ZEXPORT gzsetparams(gzFile file, int level, int strategy) { +int ZEXPORT PREFIX(gzsetparams)(gzFile file, int level, int strategy) { gz_state *state; z_stream *strm; @@ -473,7 +473,7 @@ int ZEXPORT gzsetparams(gzFile file, int level, int strategy) { } /* -- see zlib.h -- */ -int ZEXPORT gzclose_w(gzFile file) { +int ZEXPORT PREFIX(gzclose_w)(gzFile file) { int ret = Z_OK; gz_state *state; |