[cairo-commit] cairo/test buffer-diff.c, 1.6, 1.7 cairo-test.c, 1.49, 1.50 read-png.c, 1.6, 1.7

Carl Worth commit at pdx.freedesktop.org
Fri Aug 5 07:48:21 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv20852/test

Modified Files:
	buffer-diff.c cairo-test.c read-png.c 
Log Message:

2005-08-05  Carl Worth  <cworth at cworth.org>

        Patch from John Ehresman <jpe at wingide.com> to aid win32
        compilation:

        * src/cairo-output-stream.c: Define snprintf as _snprintf when
        under the influence of _MSC_VER.

        * test/read-png.c: (read_png_argb32):
        * src/cairo-wideint.h: Define int32_t and friends as __int32 and
        friends when under the influence of _MSC_VER.

        * test/buffer-diff.c:
        * test/cairo-test.c: Make include of unistd.h conditional on
        HAVE_UNISTD_H.


Index: buffer-diff.c
===================================================================
RCS file: /cvs/cairo/cairo/test/buffer-diff.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- buffer-diff.c	15 Jul 2005 17:39:59 -0000	1.6
+++ buffer-diff.c	5 Aug 2005 14:48:19 -0000	1.7
@@ -24,7 +24,9 @@
  * Author: Richard D. Worth <richard at theworths.org> */
 
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 #include <string.h>
 

Index: cairo-test.c
===================================================================
RCS file: /cvs/cairo/cairo/test/cairo-test.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- cairo-test.c	3 Aug 2005 17:32:50 -0000	1.49
+++ cairo-test.c	5 Aug 2005 14:48:19 -0000	1.50
@@ -26,7 +26,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 #include <string.h>
 #include <fontconfig/fontconfig.h>
@@ -38,6 +40,10 @@
 #include "write-png.h"
 #include "xmalloc.h"
 
+#ifdef _MSC_VER
+#define vsnprintf _vsnprintf
+#endif
+
 #define CAIRO_TEST_LOG_SUFFIX ".log"
 #define CAIRO_TEST_PNG_SUFFIX "-out.png"
 #define CAIRO_TEST_REF_SUFFIX "-ref.png"

Index: read-png.c
===================================================================
RCS file: /cvs/cairo/cairo/test/read-png.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- read-png.c	11 May 2005 03:25:38 -0000	1.6
+++ read-png.c	5 Aug 2005 14:48:19 -0000	1.7
@@ -35,6 +35,18 @@
 # include <inttypes.h>
 #elif HAVE_SYS_INT_TYPES_H
 # include <sys/int_types.h>
+#elif defined(_MSC_VER)
+  typedef __int8 int8_t;
+  typedef unsigned __int8 uint8_t;
+  typedef __int16 int16_t;
+  typedef unsigned __int16 uint16_t;
+  typedef __int32 int32_t;
+  typedef unsigned __int32 uint32_t;
+  typedef __int64 int64_t;
+  typedef unsigned __int64 uint64_t;
+# ifndef HAVE_UINT64_T
+#  define HAVE_UINT64_T 1
+# endif
 #else
 #error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
 #endif
@@ -79,7 +91,7 @@
 {
     int i;
     FILE *file;
-    static const int PNG_SIG_SIZE = 8;
+#define PNG_SIG_SIZE 8
     unsigned char png_sig[PNG_SIG_SIZE];
     int sig_bytes;
     png_struct *png;




More information about the cairo-commit mailing list