summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-08-05 07:48:18 +0000
committerCarl Worth <cworth@cworth.org>2005-08-05 07:48:18 +0000
commit0586daaa2927bfde9605487eef8e9b95c49d7d2f (patch)
tree97b334d5b7506d16f22fb454ca8c269fb3e167f2 /src
parentfd27af574d544d8adfd8cb6d5ac84837e6db43d2 (diff)
Patch from John Ehresman <jpe@wingide.com> to aid win32 compilation:
Define snprintf as _snprintf when under the influence of _MSC_VER. Define int32_t and friends as __int32 and friends when under the influence of _MSC_VER. Make include of unistd.h conditional on HAVE_UNISTD_H.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-output-stream.c4
-rw-r--r--src/cairo-wideint.h14
2 files changed, 17 insertions, 1 deletions
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index 17ef7e2cb..afb4d428d 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -39,6 +39,10 @@
#include <ctype.h>
#include "cairoint.h"
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif /* _MSC_VER */
+
struct _cairo_output_stream {
cairo_write_func_t write_data;
void *closure;
diff --git a/src/cairo-wideint.h b/src/cairo-wideint.h
index 8870df7bc..b008b5d5a 100644
--- a/src/cairo-wideint.h
+++ b/src/cairo-wideint.h
@@ -1,5 +1,5 @@
/*
- * $Id: cairo-wideint.h,v 1.11 2005-07-30 19:57:54 keithp Exp $
+ * $Id: cairo-wideint.h,v 1.12 2005-08-05 14:48:19 cworth Exp $
*
* Copyright © 2004 Keith Packard
*
@@ -44,6 +44,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