diff --git a/gfx/cairo/README b/gfx/cairo/README index 47fbcb589b8..fbffdd0abd6 100644 --- a/gfx/cairo/README +++ b/gfx/cairo/README @@ -26,6 +26,8 @@ nonfatal-assertions.patch: Make assertions non-fatal buggy-repeat.patch: Unconditionally turn on buggy-repeat handling to bandaid bug 413583. +tmpfile_wince.patch: Make Windows CE use tmpfile() on windows mobile due to the lack of _open_osfhandle and no fs permissions. + ==== pixman patches ==== endian.patch: include cairo-platform.h for endian macros diff --git a/gfx/cairo/cairo/src/Makefile.in b/gfx/cairo/cairo/src/Makefile.in index 7c17ea31bf2..56bd7a17fc4 100644 --- a/gfx/cairo/cairo/src/Makefile.in +++ b/gfx/cairo/cairo/src/Makefile.in @@ -146,10 +146,9 @@ PDF_EXPORTS = cairo-pdf.h PS_EXPORTS = cairo-ps.h ifeq ($(MOZ_WIDGET_TOOLKIT),windows) -CSRCS += cairo-win32.c \ - cairo-win32-font.c \ - cairo-win32-surface.c \ - cairo-win32-printing-surface.c +CSRCS += cairo-win32-font.c \ + cairo-win32-surface.c \ + cairo-win32-printing-surface.c EXPORTS += cairo-win32.h CSRCS += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS) EXPORTS += $(PDF_EXPORTS) diff --git a/gfx/cairo/cairo/src/cairo-misc.c b/gfx/cairo/cairo/src/cairo-misc.c index b927c9418e5..5a222b645b0 100644 --- a/gfx/cairo/cairo/src/cairo-misc.c +++ b/gfx/cairo/cairo/src/cairo-misc.c @@ -625,6 +625,9 @@ _cairo_lround (double d) FILE * _cairo_win32_tmpfile (void) { +#ifdef WINCE // we don't have to worry here about permissions + return tmpfile(); +#else DWORD path_len; WCHAR path_name[MAX_PATH + 1]; WCHAR file_name[MAX_PATH + 1]; @@ -664,6 +667,7 @@ _cairo_win32_tmpfile (void) } return fp; +#endif /* WINCE */ } #endif /* _WIN32 */ diff --git a/gfx/cairo/tmpfile_wince.patch b/gfx/cairo/tmpfile_wince.patch new file mode 100644 index 00000000000..12d1dfadc84 --- /dev/null +++ b/gfx/cairo/tmpfile_wince.patch @@ -0,0 +1,36 @@ +diff --git a/gfx/cairo/cairo/src/cairo-misc.c b/gfx/cairo/cairo/src/cairo-misc.c +--- a/gfx/cairo/cairo/src/cairo-misc.c ++++ b/gfx/cairo/cairo/src/cairo-misc.c +@@ -620,16 +620,19 @@ _cairo_lround (double d) + /* tmpfile() replacment for Windows. + * + * On Windows tmpfile() creates the file in the root directory. This + * may fail due to unsufficient privileges. + */ + FILE * + _cairo_win32_tmpfile (void) + { ++#ifdef WINCE // we don't have to worry here about permissions ++ return tmpfile(); ++#else + DWORD path_len; + WCHAR path_name[MAX_PATH + 1]; + WCHAR file_name[MAX_PATH + 1]; + HANDLE handle; + int fd; + FILE *fp; + + path_len = GetTempPathW (MAX_PATH, path_name); +@@ -659,11 +662,12 @@ _cairo_win32_tmpfile (void) + + fp = fdopen(fd, "w+b"); + if (fp == NULL) { + _close(fd); + return NULL; + } + + return fp; ++#endif /* WINCE */ + } + + #endif /* _WIN32 */