Bug 456644 - WinCE gfx cairo _cairo_win32_tmpfile does not compile. r=vlad

This commit is contained in:
Doug Turner 2008-09-26 15:30:51 -07:00
parent d9a97b31c8
commit ae8db696dd
4 changed files with 45 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 */

View File

@ -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 */