]> git.pld-linux.org Git - packages/crossmingw32-cairo.git/blame - cairo-mingw32.patch
- updated to 1.12.0
[packages/crossmingw32-cairo.git] / cairo-mingw32.patch
CommitLineData
ead09fb0
JB
1--- cairo-1.12.0/util/cairo-missing/cairo-missing.h.orig 2012-02-02 01:48:15.000000000 +0100
2+++ cairo-1.12.0/util/cairo-missing/cairo-missing.h 2012-03-25 12:56:29.970335651 +0200
3@@ -37,7 +37,7 @@
4 #include <string.h>
5 #include <sys/types.h>
6
7-#ifdef _WIN32
8+#if defined(_WIN32) && !defined(__MINGW32__)
9 #define WIN32_LEAN_AND_MEAN
10 #include <windows.h>
11
12--- cairo-1.12.0/test/any2ppm.c.orig 2012-02-29 13:10:30.000000000 +0100
13+++ cairo-1.12.0/test/any2ppm.c 2012-03-25 13:20:49.717047188 +0200
14@@ -120,7 +120,7 @@
15 }
16
17 static int
18-_write (int fd,
19+_cairo_write (int fd,
20 char *buf, int maxlen, int buflen,
21 const unsigned char *src, int srclen)
22 {
23@@ -204,7 +204,7 @@
24
25 switch ((int) format) {
26 case CAIRO_FORMAT_ARGB32:
27- len = _write (fd,
28+ len = _cairo_write (fd,
29 buf, sizeof (buf), len,
30 (unsigned char *) row, 4 * width);
31 break;
32@@ -215,13 +215,13 @@
33 rgb[0] = (p & 0xff0000) >> 16;
34 rgb[1] = (p & 0x00ff00) >> 8;
35 rgb[2] = (p & 0x0000ff) >> 0;
36- len = _write (fd,
37+ len = _cairo_write (fd,
38 buf, sizeof (buf), len,
39 rgb, 3);
40 }
41 break;
42 case CAIRO_FORMAT_A8:
43- len = _write (fd,
44+ len = _cairo_write (fd,
45 buf, sizeof (buf), len,
46 (unsigned char *) row, width);
47 break;
48--- cairo-1.12.0/boilerplate/cairo-boilerplate-win32-printing.c.orig 2012-02-29 13:10:30.000000000 +0100
49+++ cairo-1.12.0/boilerplate/cairo-boilerplate-win32-printing.c 2012-03-25 17:00:32.410822070 +0200
50@@ -41,6 +41,7 @@
51 #include <cairo-win32.h>
52 #include <cairo-paginated-surface-private.h>
53
54+#include <wchar.h>
55 #include <windows.h>
56
57 #if !defined(POSTSCRIPT_IDENTIFY)
58@@ -59,8 +60,35 @@
59 # define FEATURESETTING_PSLEVEL 0x0002
60 #endif
61
62-cairo_status_t
63-_cairo_win32_print_gdi_error (const char *context);
64+/* private function copied from cairo-win32-surface.c */
65+static cairo_status_t
66+_cairo_win32_print_gdi_error (const char *context)
67+{
68+ void *lpMsgBuf;
69+ DWORD last_error = GetLastError ();
70+
71+ if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
72+ FORMAT_MESSAGE_FROM_SYSTEM,
73+ NULL,
74+ last_error,
75+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
76+ (LPWSTR) &lpMsgBuf,
77+ 0, NULL)) {
78+ fprintf (stderr, "%s: Unknown GDI error", context);
79+ } else {
80+ fprintf (stderr, "%s: %S", context, (wchar_t *)lpMsgBuf);
81+
82+ LocalFree (lpMsgBuf);
83+ }
84+
85+ fflush (stderr);
86+
87+ /* We should switch off of last_status, but we'd either return
88+ * CAIRO_STATUS_NO_MEMORY or CAIRO_STATUS_UNKNOWN_ERROR and there
89+ * is no CAIRO_STATUS_UNKNOWN_ERROR.
90+ */
91+ return CAIRO_STATUS_NO_MEMORY;
92+}
93
94 static cairo_user_data_key_t win32_closure_key;
95
This page took 0.123369 seconds and 4 git commands to generate.