diff --git a/src/3rdparty/zlib/gzguts.h b/src/3rdparty/zlib/gzguts.h index c752b5763b6..26b4d37c1d2 100644 --- a/src/3rdparty/zlib/gzguts.h +++ b/src/3rdparty/zlib/gzguts.h @@ -32,7 +32,10 @@ # include #endif #if !defined(_WIN32_WCE) -#include +# include +#else +# include +# include #endif #ifdef NO_DEFLATE /* for compatibility with old definition */ @@ -40,7 +43,9 @@ #endif #ifdef _MSC_VER -# include +# if !defined(_WIN32_WCE) +# include +# endif # define vsnprintf _vsnprintf #endif diff --git a/src/3rdparty/zlib/zutil.c b/src/3rdparty/zlib/zutil.c index 898ed345b0e..3418c5999fd 100644 --- a/src/3rdparty/zlib/zutil.c +++ b/src/3rdparty/zlib/zutil.c @@ -136,14 +136,6 @@ const char * ZEXPORT zError(err) return ERR_MSG(err); } -#if defined(_WIN32_WCE) - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. - */ - int errno = 0; -#endif - #ifndef HAVE_MEMCPY void ZLIB_INTERNAL zmemcpy(dest, source, len) diff --git a/src/corelib/kernel/qfunctions_wince.h b/src/corelib/kernel/qfunctions_wince.h index f83dad0dde6..7cd8ea66a22 100644 --- a/src/corelib/kernel/qfunctions_wince.h +++ b/src/corelib/kernel/qfunctions_wince.h @@ -182,6 +182,16 @@ void qt_wince_rewind( FILE *stream ); int qt_wince___fileno(FILE *); FILE *qt_wince_tmpfile( void ); +//For zlib we need these helper functions, but they break the build when +//set globally, so just set them for zlib use +#ifdef ZLIB_H +#define open qt_wince_open +#define close qt_wince__close +#define lseek qt_wince__lseek +#define read qt_wince__read +#define write qt_wince__write +#endif + int qt_wince__mkdir(const char *dirname); int qt_wince__rmdir(const char *dirname); int qt_wince__access( const char *path, int pmode );