summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/TLPATCHES/patch-41-W32TeX
blob: 28efb4219f3673587e68537c3b81f7ec3857c7fc (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
177
diff -ur -N xpdf-3.04.orig/goo/gfile.cc xpdf-3.04/goo/gfile.cc
--- xpdf-3.04.orig/goo/gfile.cc	2014-05-30 19:42:41.000000000 +0200
+++ xpdf-3.04/goo/gfile.cc	2015-05-09 15:49:36.000000000 +0200
@@ -55,7 +55,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(".");
@@ -559,7 +563,7 @@
 
 GBool createDir(char *path, int mode) {
 #ifdef _WIN32
-  return !mkdir(path);
+  return !_mkdir(path);
 #else
   return !mkdir(path, mode);
 #endif
diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
--- xpdf-3.04.orig/xpdf/GlobalParams.cc	2014-05-30 19:52:04.000000000 +0200
+++ xpdf-3.04/xpdf/GlobalParams.cc	2015-05-07 08:43:30.000000000 +0200
@@ -16,7 +16,9 @@
 #endif
 
 #ifdef _WIN32
+#  ifndef _WIN32_WINNT
 #  define _WIN32_WINNT 0x0500 // for GetSystemWindowsDirectory
+#  endif
 #  include <windows.h>
 #endif
 #include <string.h>
@@ -54,8 +56,8 @@
 #ifdef _WIN32
 #  undef strcasecmp
 #  undef strncasecmp
-#  define strcasecmp stricmp
-#  define strncasecmp strnicmp
+#  define strcasecmp _stricmp
+#  define strncasecmp _strnicmp
 #else
 #  include <strings.h>
 #endif
@@ -2138,8 +2140,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 -N xpdf-3.04.orig/xpdf/pdfdetach.cc xpdf-3.04/xpdf/pdfdetach.cc
--- xpdf-3.04.orig/xpdf/pdfdetach.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdfdetach.cc	2015-05-07 08:43:30.000000000 +0200
@@ -74,6 +74,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if ((doList ? 1 : 0) +
diff -ur -N xpdf-3.04.orig/xpdf/pdffonts.cc xpdf-3.04/xpdf/pdffonts.cc
--- xpdf-3.04.orig/xpdf/pdffonts.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdffonts.cc	2015-05-07 08:43:30.000000000 +0200
@@ -107,6 +107,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 2 || printVersion || printHelp) {
diff -ur -N xpdf-3.04.orig/xpdf/pdfimages.cc xpdf-3.04/xpdf/pdfimages.cc
--- xpdf-3.04.orig/xpdf/pdfimages.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdfimages.cc	2015-05-07 08:43:30.000000000 +0200
@@ -76,6 +76,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 3 || printVersion || printHelp) {
diff -ur -N xpdf-3.04.orig/xpdf/pdfinfo.cc xpdf-3.04/xpdf/pdfinfo.cc
--- xpdf-3.04.orig/xpdf/pdfinfo.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdfinfo.cc	2015-05-07 08:43:30.000000000 +0200
@@ -100,6 +100,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 2 || printVersion || printHelp) {
diff -ur -N xpdf-3.04.orig/xpdf/pdftohtml.cc xpdf-3.04/xpdf/pdftohtml.cc
--- xpdf-3.04.orig/xpdf/pdftohtml.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdftohtml.cc	2015-05-07 08:43:30.000000000 +0200
@@ -86,6 +86,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 3 || printVersion || printHelp) {
diff -ur -N xpdf-3.04.orig/xpdf/pdftopng.cc xpdf-3.04/xpdf/pdftopng.cc
--- xpdf-3.04.orig/xpdf/pdftopng.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdftopng.cc	2015-05-07 08:43:30.000000000 +0200
@@ -99,6 +99,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (mono && gray) {
diff -ur -N xpdf-3.04.orig/xpdf/pdftoppm.cc xpdf-3.04/xpdf/pdftoppm.cc
--- xpdf-3.04.orig/xpdf/pdftoppm.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdftoppm.cc	2015-05-07 08:43:30.000000000 +0200
@@ -111,6 +111,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (mono && gray) {
diff -ur -N xpdf-3.04.orig/xpdf/pdftops.cc xpdf-3.04/xpdf/pdftops.cc
--- xpdf-3.04.orig/xpdf/pdftops.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdftops.cc	2015-05-07 08:43:30.000000000 +0200
@@ -168,6 +168,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {
diff -ur -N xpdf-3.04.orig/xpdf/pdftotext.cc xpdf-3.04/xpdf/pdftotext.cc
--- xpdf-3.04.orig/xpdf/pdftotext.cc	2014-05-28 20:50:50.000000000 +0200
+++ xpdf-3.04/xpdf/pdftotext.cc	2015-05-07 08:43:30.000000000 +0200
@@ -129,6 +129,9 @@
 
   exitCode = 99;
 
+#ifdef _MSC_VER
+  (void)kpse_set_program_name(argv[0], NULL);
+#endif
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {