[cairo-commit] test/pdiff

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Apr 3 13:03:50 PDT 2007


 test/pdiff/pdiff.c |   37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 insertions(+), 1 deletion(-)

New commits:
diff-tree 17f5706d1730662bce0cd49f60cb150773fac051 (from c2b1908f9b0d8c59abf79c3462471d1c3960b153)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 3 16:04:04 2007 -0400

    [pdiff] Make stdint.h inclusion portable (#10441)
    by copying magic bits from cairo-wideint-private.h.

diff --git a/test/pdiff/pdiff.c b/test/pdiff/pdiff.c
index 91e0caf..b75312d 100644
--- a/test/pdiff/pdiff.c
+++ b/test/pdiff/pdiff.c
@@ -16,11 +16,46 @@
 
 #define _GNU_SOURCE
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "lpyramid.h"
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
+
+#if   HAVE_STDINT_H
+# include <stdint.h>
+#elif HAVE_INTTYPES_H
+# 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
+# ifndef INT16_MIN
+#  define INT16_MIN	(-32767-1)
+# endif
+# ifndef INT16_MAX
+#  define INT16_MAX	(32767)
+# endif
+# ifndef UINT16_MAX
+#  define UINT16_MAX	(65535)
+# endif
+#else
+#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
+#endif
+
 #include "pdiff.h"
 
 #ifndef M_PI


More information about the cairo-commit mailing list