comparison src/mingw-ghostscript-1-win.patch @ 3793:50f11d938045

ghostscript: simplify patches * src/mingw-ghostscript-1-win.patch: change patch to just define the binary character when mingw. * src/gnu-linux-ghostscript-configure.patch: removed old patch file. * dist-files.mk: remove ref to src/gnu-linux-ghostscript-configure.patch.
author John Donoghue
date Mon, 16 Feb 2015 09:01:11 -0500
parents 1a2fec9962a7
children
comparison
equal deleted inserted replaced
3792:1a2fec9962a7 3793:50f11d938045
1 diff -ur ghostscript-9.15.orig/base/gp_unifs.c ghostscript-9.15/base/gp_unifs.c 1 diff -ur ghostscript-9.15.orig/base/gp_unifn.c ghostscript-9.15/base/gp_unifn.c
2 --- ghostscript-9.15.orig/base/gp_unifs.c 2015-02-15 10:31:35.198127593 -0500 2 --- ghostscript-9.15.orig/base/gp_unifn.c 2015-02-16 07:47:31.050998971 -0500
3 +++ ghostscript-9.15/base/gp_unifs.c 2015-02-15 13:11:28.950483663 -0500 3 +++ ghostscript-9.15/base/gp_unifn.c 2015-02-16 07:48:50.582467223 -0500
4 @@ -80,6 +80,14 @@ 4 @@ -25,7 +25,11 @@
5 int prefix_length = strlen(prefix); 5
6 int len = gp_file_name_sizeof - prefix_length - 8; 6 /* Define the string to be concatenated with the file mode */
7 FILE *fp; 7 /* for opening files without end-of-line conversion. */
8 +#ifdef __MINGW32__ 8 +#if (defined(__MINGW32__) && __MINGW32__ == 1) || (defined(__CYGWIN__) && __CYGWIN__ == 1)
9 + // add 'b' to ensure in binary mode 9 +const char gp_fmode_binary_suffix[] = "b";
10 + char tmpmode[32]; 10 +#else
11 + 11 const char gp_fmode_binary_suffix[] = "";
12 + strcpy(tmpmode, mode);
13 + strcat(tmpmode,"b");
14 + mode = tmpmode;
15 +#endif 12 +#endif
16 13
17 if (gp_file_name_is_absolute(prefix, prefix_length)) 14 /* Define the file modes for binary reading or writing. */
18 *fname = 0; 15 #if (defined(__MINGW32__) && __MINGW32__ == 1) || (defined(__CYGWIN__) && __CYGWIN__ == 1)
19 @@ -148,6 +156,15 @@
20 FILE *
21 gp_fopen(const char *fname, const char *mode)
22 {
23 +#ifdef __MINGW32__
24 + // add 'b' to ensure in binary mode
25 + char tmpmode[32];
26 +
27 + strcpy(tmpmode, mode);
28 + strcat(tmpmode,"b");
29 + mode = tmpmode;
30 +#endif
31 +
32 return fopen(fname, mode);
33 }
34