[Zlib-devel] zlib 1.2.0.8 FINAL release candidate available

Cosmin Truta cosmin at cs.toronto.edu
Wed Nov 12 12:10:51 EST 2003


On Wed, 12 Nov 2003, Alexander Mai wrote:

> Sorry for being late, just thought it's time to check again on Windows
> CE. A minor (CE only) patch is attached.

There are problems with this patch. ptrdiff_t is present on WinCE.NET,
which means that compilation may break if <stddef.h> gets included
"zutil.h" on this platform. Another problem is that ptrdiff_t cannot
equate to size_t, because it has to be a signed type. size_t is usually
unsigned.

Here is a better patch. "_SOME_SYMBOL_T_DEFINED" is the guard which
Visual C uses to verify the presence of "some_symbol_t". NOT TESTED!


--- zutil.h~    Sat Sep 20 11:49:03 2003
+++ zutil.h     Wed Nov 12 12:01:00 2003
@@ -139,6 +139,10 @@
 #if (defined(_MSC_VER) && (_MSC_VER > 600))
 #  if defined(_WIN32_WCE)
 #    define fdopen(fd,mode) NULL /* No fdopen() */
+#    ifndef _PTRDIFF_T_DEFINED
+       typedef int ptrdiff_t;
+#      define _PTRDIFF_T_DEFINED
+#    endif
 #  else
 #    define fdopen(fd,type)  _fdopen(fd,type)
 #  endif


Gosh! what would have costed those Micro$oft guys to support ANSI C
properly, 12 years after it has been published?!?


Best regards,
Cosmin




More information about the Zlib-devel mailing list