Debian Codegraph @

texk/cjkutils/TLpatches/patch-05-win32

raw
1 diff -ur cjkutils-4.8.5.orig/Bg5conv/bg5conv.w cjkutils-4.8.5/Bg5conv/bg5conv.w
2 --- cjkutils-4.8.5.orig/Bg5conv/bg5conv.w 2021-10-17 02:25:02.000000000 +0900
3 +++ cjkutils-4.8.5/Bg5conv/bg5conv.w 2022-01-23 03:37:41.000000000 +0900
4 @@ -93,12 +93,19 @@
5
6 @c
7 #include <stdio.h>
8 -#include <stdlib.h>@#
9 +#include <stdlib.h>
10 +#ifdef WIN32
11 +#include <fcntl.h>
12 +#include <io.h>
13 +#endif@#
14
15
16 int main(int argc, char *argv[])
17 {int ch;
18
19 +#ifdef WIN32
20 + setmode(fileno(stdout), _O_BINARY);
21 +#endif
22 fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@#
23
24 ch = fgetc(stdin);@#
25 diff -ur cjkutils-4.8.5.orig/CEFconv/cef5conv.w cjkutils-4.8.5/CEFconv/cef5conv.w
26 --- cjkutils-4.8.5.orig/CEFconv/cef5conv.w 2021-10-17 02:25:02.000000000 +0900
27 +++ cjkutils-4.8.5/CEFconv/cef5conv.w 2022-01-23 03:37:41.000000000 +0900
28 @@ -108,7 +108,11 @@
29 @c
30 #include <ctype.h>
31 #include <stdio.h>
32 -#include <stdlib.h>@#
33 +#include <stdlib.h>
34 +#ifdef WIN32
35 +#include <fcntl.h>
36 +#include <io.h>
37 +#endif@#
38
39
40 int main(int argc, char *argv[])
41 @@ -117,6 +121,9 @@
42 unsigned char out[32];
43 unsigned char *inp, *outp;
44
45 +#ifdef WIN32
46 + setmode(fileno(stdout), _O_BINARY);
47 +#endif
48 fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@#
49
50 ch = fgetc(stdin);@#
51 diff -ur cjkutils-4.8.5.orig/CEFconv/cefconv.w cjkutils-4.8.5/CEFconv/cefconv.w
52 --- cjkutils-4.8.5.orig/CEFconv/cefconv.w 2021-10-17 02:25:02.000000000 +0900
53 +++ cjkutils-4.8.5/CEFconv/cefconv.w 2022-01-23 03:37:41.000000000 +0900
54 @@ -100,7 +100,11 @@
55 @c
56 #include <ctype.h>
57 #include <stdio.h>
58 -#include <stdlib.h>@#
59 +#include <stdlib.h>
60 +#ifdef WIN32
61 +#include <fcntl.h>
62 +#include <io.h>
63 +#endif@#
64
65
66 int main(int argc, char *argv[])
67 @@ -109,6 +113,9 @@
68 unsigned char out[32];
69 unsigned char *inp, *outp;
70
71 +#ifdef WIN32
72 + setmode(fileno(stdout), _O_BINARY);
73 +#endif
74 fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@#
75
76 ch = fgetc(stdin);@#
77 diff -ur cjkutils-4.8.5.orig/CEFconv/cefsconv.w cjkutils-4.8.5/CEFconv/cefsconv.w
78 --- cjkutils-4.8.5.orig/CEFconv/cefsconv.w 2021-10-17 02:25:02.000000000 +0900
79 +++ cjkutils-4.8.5/CEFconv/cefsconv.w 2022-01-23 03:37:41.000000000 +0900
80 @@ -111,7 +111,11 @@
81 @c
82 #include <ctype.h>
83 #include <stdio.h>
84 -#include <stdlib.h>@#
85 +#include <stdlib.h>
86 +#ifdef WIN32
87 +#include <fcntl.h>
88 +#include <io.h>
89 +#endif@#
90
91
92 int main(int argc, char *argv[])
93 @@ -120,6 +124,9 @@
94 unsigned char out[32];
95 unsigned char *inp, *outp;
96
97 +#ifdef WIN32
98 + setmode(fileno(stdout), _O_BINARY);
99 +#endif
100 fprintf(stdout, "\\def\\CNSpreproc{%s}", banner);@#
101
102 ch = fgetc(stdin);@#
103 diff -ur cjkutils-4.8.5.orig/SJISconv/sjisconv.w cjkutils-4.8.5/SJISconv/sjisconv.w
104 --- cjkutils-4.8.5.orig/SJISconv/sjisconv.w 2021-10-17 02:25:02.000000000 +0900
105 +++ cjkutils-4.8.5/SJISconv/sjisconv.w 2022-01-23 03:37:41.000000000 +0900
106 @@ -95,12 +95,19 @@
107
108 @c
109 #include <stdio.h>
110 -#include <stdlib.h>@#
111 +#include <stdlib.h>
112 +#ifdef WIN32
113 +#include <fcntl.h>
114 +#include <io.h>
115 +#endif@#
116
117
118 int main(int argc, char *argv[])
119 {int ch;
120
121 +#ifdef WIN32
122 + setmode(fileno(stdout), _O_BINARY);
123 +#endif
124 fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@#
125
126 ch = fgetc(stdin);@#
127 diff -ur cjkutils-4.8.5.orig/extconv/extconv.w cjkutils-4.8.5/extconv/extconv.w
128 --- cjkutils-4.8.5.orig/extconv/extconv.w 2021-10-17 02:25:02.000000000 +0900
129 +++ cjkutils-4.8.5/extconv/extconv.w 2022-01-23 03:37:41.000000000 +0900
130 @@ -93,12 +93,19 @@
131
132 @c
133 #include <stdio.h>
134 -#include <stdlib.h>@#
135 +#include <stdlib.h>
136 +#ifdef WIN32
137 +#include <fcntl.h>
138 +#include <io.h>
139 +#endif@#
140
141
142 int main(int argc, char *argv[])
143 {int ch;
144
145 +#ifdef WIN32
146 + setmode(fileno(stdout), _O_BINARY);
147 +#endif
148
149 fprintf(stdout, "\\def\\CJKpreproc{%s}", banner);@#
150
151 diff -ur cjkutils-4.8.5.orig/hbf2gf/hbf2gf.w cjkutils-4.8.5/hbf2gf/hbf2gf.w
152 --- cjkutils-4.8.5.orig/hbf2gf/hbf2gf.w 2021-10-17 02:25:02.000000000 +0900
153 +++ cjkutils-4.8.5/hbf2gf/hbf2gf.w 2022-01-23 03:37:41.000000000 +0900
154 @@ -148,9 +148,9 @@
155 FILE *config, *out;
156 HBF *hbf;@#
157
158 -#ifdef msdos /* if we compile under DOS or OS/2 */
159 +#ifdef WIN32
160 #define WRITE_BIN "wb"
161 -#define WRITE_TXT "wt"
162 +#define WRITE_TXT "wb"
163 #define READ_BIN "rb"
164 #define READ_TXT "rt"
165 #else