summaryrefslogtreecommitdiff
path: root/test/pdiff/pdiff.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-04-03 16:04:04 -0400
committerBehdad Esfahbod <behdad@behdad.org>2007-04-03 16:04:04 -0400
commit17f5706d1730662bce0cd49f60cb150773fac051 (patch)
tree5b9719b4c2c5d374066667dd1f4731c8afead41b /test/pdiff/pdiff.c
parentc2b1908f9b0d8c59abf79c3462471d1c3960b153 (diff)
[pdiff] Make stdint.h inclusion portable (#10441)
by copying magic bits from cairo-wideint-private.h.
Diffstat (limited to 'test/pdiff/pdiff.c')
-rw-r--r--test/pdiff/pdiff.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/test/pdiff/pdiff.c b/test/pdiff/pdiff.c
index 91e0cafe..b75312df 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