summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/TLpatches/patch-bunched
blob: 57d1de7e4b874f50cc1bf88a537d961e78d133ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
diff -ur xpdf-4.00.orig/goo/gfile.cc xpdf-4.00/goo/gfile.cc
--- xpdf-4.00.orig/goo/gfile.cc	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/goo/gfile.cc	Sun Aug 13 13:46:03 2017
@@ -7,6 +7,9 @@
 // Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #include <aconf.h>
 
@@ -51,7 +54,11 @@
   char *s;
   GString *ret;
 
+#ifdef _WIN32
+  if ((s = getenv("USERPROFILE")))
+#else
   if ((s = getenv("HOME")))
+#endif
     ret = new GString(s);
   else
     ret = new GString(".");
@@ -400,6 +407,7 @@
 #endif
 }
 
+#ifndef PDF_PARSER_ONLY
 GBool openTempFile(GString **name, FILE **f,
 		   const char *mode, const char *ext) {
 #if defined(_WIN32)
@@ -514,10 +522,11 @@
   return gTrue;
 #endif
 }
+#endif
 
 GBool createDir(char *path, int mode) {
 #ifdef _WIN32
-  return !mkdir(path);
+  return !_mkdir(path);
 #else
   return !mkdir(path, mode);
 #endif
diff -ur xpdf-4.00.orig/xpdf/GlobalParams.cc xpdf-4.00/xpdf/GlobalParams.cc
--- xpdf-4.00.orig/xpdf/GlobalParams.cc	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/xpdf/GlobalParams.cc	Sun Aug 13 13:51:37 2017
@@ -5,6 +5,9 @@
 // Copyright 2001-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #include <aconf.h>
 
@@ -38,8 +41,12 @@
 #include "GlobalParams.h"
 
 #ifdef _WIN32
-#  define strcasecmp stricmp
-#  define strncasecmp strnicmp
+#  undef strcasecmp
+#  undef strncasecmp
+#  define strcasecmp _stricmp
+#  define strncasecmp _strnicmp
+#else
+#  include <strings.h>
 #endif
 
 #if MULTITHREADED
@@ -677,6 +684,7 @@
   f = NULL;
   fileName = NULL;
   if (cfgFileName && cfgFileName[0]) {
+#ifndef PDF_PARSER_ONLY
     fileName = new GString(cfgFileName);
     if (!(f = fopen(fileName->getCString(), "r"))) {
       delete fileName;
@@ -709,6 +717,7 @@
     parseFile(fileName, f);
     delete fileName;
     fclose(f);
+#endif /* !PDF_PARSER_ONLY */
   }
 }
 
@@ -2105,8 +2114,11 @@
 				   base14->fontNum,
 				   displayFontTab[i].obliqueFactor));
       } else {
+// Do not display unnecessary looking message on W32
+#ifndef _WIN32
 	error(errConfig, -1, "No display font for '{0:s}'",
 	      displayFontTab[i].name);
+#endif
       }
     }
   }
diff -ur xpdf-4.00.orig/xpdf/GlobalParams.h xpdf-4.00/xpdf/GlobalParams.h
--- xpdf-4.00.orig/xpdf/GlobalParams.h	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/xpdf/GlobalParams.h	Sun Aug 13 13:32:19 2017
@@ -5,6 +5,9 @@
 // Copyright 2001-2003 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef GLOBALPARAMS_H
 #define GLOBALPARAMS_H
@@ -217,7 +220,7 @@
 
   // Initialize the global parameters by attempting to read a config
   // file.
-  GlobalParams(const char *cfgFileName);
+  GlobalParams(const char *cfgFileName = NULL);
 
   ~GlobalParams();
 
diff -ur xpdf-4.00.orig/xpdf/Page.cc xpdf-4.00/xpdf/Page.cc
--- xpdf-4.00.orig/xpdf/Page.cc	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/xpdf/Page.cc	Sun Aug 13 13:24:07 2017
@@ -480,9 +480,9 @@
   delete links;
 }
 
-#ifndef PDF_PARSER_ONLY
 void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
 			 int rotate, GBool useMediaBox, GBool upsideDown) {
+#ifndef PDF_PARSER_ONLY
   GfxState *state;
   int i;
 
@@ -499,5 +499,5 @@
     ctm[i] = state->getCTM()[i];
   }
   delete state;
-}
 #endif
+}
diff -ur xpdf-4.00.orig/xpdf/XFAForm.cc xpdf-4.00/xpdf/XFAForm.cc
--- xpdf-4.00.orig/xpdf/XFAForm.cc	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/xpdf/XFAForm.cc	Sun Aug 13 14:28:34 2017
@@ -27,8 +27,10 @@
 #include "XFAForm.h"
 
 #ifdef _WIN32
-#  define strcasecmp stricmp
-#  define strncasecmp strnicmp
+#  undef strcasecmp
+#  undef strncasecmp
+#  define strcasecmp _stricmp
+#  define strncasecmp _strnicmp
 #endif
 
 //------------------------------------------------------------------------
diff -ur xpdf-4.00.orig/xpdf/config.h xpdf-4.00/xpdf/config.h
--- xpdf-4.00.orig/xpdf/config.h	Wed Aug 09 08:22:50 2017
+++ xpdf-4.00/xpdf/config.h	Sun Aug 13 13:42:04 2017
@@ -78,11 +78,6 @@
 // popen
 //------------------------------------------------------------------------
 
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-#define popen _popen
-#define pclose _pclose
-#endif
-
 #if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__)
 #define POPEN_READ_MODE "rb"
 #else