diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/zlib.cpp | 4 | ||||
| -rw-r--r-- | common/zlib.h | 25 |
2 files changed, 13 insertions, 16 deletions
diff --git a/common/zlib.cpp b/common/zlib.cpp index 7e14a9e3ab..4f7c17f413 100644 --- a/common/zlib.cpp +++ b/common/zlib.cpp @@ -34,8 +34,8 @@ namespace Common { -int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) { - return ::uncompress(dst, dstLen, src, srcLen); +bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen) { + return Z_OK == ::uncompress(dst, dstLen, src, srcLen); } } // end of namespace Common diff --git a/common/zlib.h b/common/zlib.h index 62e9f98c01..1354134816 100644 --- a/common/zlib.h +++ b/common/zlib.h @@ -22,26 +22,23 @@ * $Id$ */ -#include "common/scummsys.h" - -#if defined(USE_ZLIB) - #ifndef COMMON_ZLIB_H #define COMMON_ZLIB_H -#ifdef __SYMBIAN32__ -#include <zlib\zlib.h> -#else -#include <zlib.h> -#endif +#include "common/scummsys.h" -namespace Common { +#if defined(USE_ZLIB) -enum { - ZLIB_OK = Z_OK -}; +namespace Common { -int uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen); +/** + * Thin wrapper around zlib's uncompress() function. This wrapper makes + * it possible to uncompress data in engines without being forced to link + * them against zlib, thus simplifying the build system. + * + * @return true on success (i.e. Z_OK), false otherwise + */ +bool uncompress(byte *dst, unsigned long *dstLen, const byte *src, unsigned long srcLen); } // end of namespace Common |
