1 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/hostname.c gettext-tools/src/hostname.c
2 --- gettext-tools/src/hostname.c 2005-05-20 16:40:02.000000000 -0400
3 +++ gettext-tools/src/hostname.c 2005-11-11 11:02:07.203125000 -0500
5 static enum { default_format, short_format, long_format, ip_format } format;
8 -static const struct option long_options[] =
9 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
11 { "fqdn", no_argument, NULL, 'f' },
12 { "help", no_argument, NULL, 'h' },
13 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgattrib.c gettext-tools/src/msgattrib.c
14 --- gettext-tools/src/msgattrib.c 2005-05-20 16:40:15.000000000 -0400
15 +++ gettext-tools/src/msgattrib.c 2005-11-11 11:01:39.484375000 -0500
20 -static const struct option long_options[] =
21 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
23 { "add-location", no_argument, &line_comment, 1 },
24 { "clear-fuzzy", no_argument, NULL, CHAR_MAX + 8 },
25 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgcat.c gettext-tools/src/msgcat.c
26 --- gettext-tools/src/msgcat.c 2005-05-20 16:40:19.000000000 -0400
27 +++ gettext-tools/src/msgcat.c 2005-11-11 11:02:33.109375000 -0500
29 static const char *to_code;
32 -static const struct option long_options[] =
33 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
35 { "add-location", no_argument, &line_comment, 1 },
36 { "directory", required_argument, NULL, 'D' },
37 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgcmp.c gettext-tools/src/msgcmp.c
38 --- gettext-tools/src/msgcmp.c 2005-05-20 16:40:23.000000000 -0400
39 +++ gettext-tools/src/msgcmp.c 2005-11-11 11:02:51.906250000 -0500
41 static bool multi_domain_mode = false;
44 -static const struct option long_options[] =
45 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
47 { "directory", required_argument, NULL, 'D' },
48 { "help", no_argument, NULL, 'h' },
49 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgcomm.c gettext-tools/src/msgcomm.c
50 --- gettext-tools/src/msgcomm.c 2005-05-20 16:40:27.000000000 -0400
51 +++ gettext-tools/src/msgcomm.c 2005-11-11 11:03:09.406250000 -0500
53 static const char *to_code;
56 -static const struct option long_options[] =
57 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
59 { "add-location", no_argument, &line_comment, 1 },
60 { "directory", required_argument, NULL, 'D' },
61 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgconv.c gettext-tools/src/msgconv.c
62 --- gettext-tools/src/msgconv.c 2005-05-20 16:40:31.000000000 -0400
63 +++ gettext-tools/src/msgconv.c 2005-11-11 11:03:21.671875000 -0500
65 static const char *to_code;
68 -static const struct option long_options[] =
69 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
71 { "add-location", no_argument, &line_comment, 1 },
72 { "directory", required_argument, NULL, 'D' },
73 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgen.c gettext-tools/src/msgen.c
74 --- gettext-tools/src/msgen.c 2005-05-20 16:40:35.000000000 -0400
75 +++ gettext-tools/src/msgen.c 2005-11-11 11:03:54.531250000 -0500
80 -static const struct option long_options[] =
81 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
83 { "add-location", no_argument, &line_comment, 1 },
84 { "directory", required_argument, NULL, 'D' },
85 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgexec.c gettext-tools/src/msgexec.c
86 --- gettext-tools/src/msgexec.c 2005-05-20 16:40:40.000000000 -0400
87 +++ gettext-tools/src/msgexec.c 2005-11-11 11:04:07.546875000 -0500
92 -static const struct option long_options[] =
93 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
95 { "directory", required_argument, NULL, 'D' },
96 { "help", no_argument, NULL, 'h' },
97 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgfilter.c gettext-tools/src/msgfilter.c
98 --- gettext-tools/src/msgfilter.c 2005-05-20 16:40:44.000000000 -0400
99 +++ gettext-tools/src/msgfilter.c 2005-11-11 11:04:19.062500000 -0500
104 -static const struct option long_options[] =
105 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
107 { "add-location", no_argument, &line_comment, 1 },
108 { "directory", required_argument, NULL, 'D' },
109 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgfmt.c gettext-tools/src/msgfmt.c
110 --- gettext-tools/src/msgfmt.c 2005-11-11 00:58:30.000000000 -0500
111 +++ gettext-tools/src/msgfmt.c 2005-11-11 11:04:30.546875000 -0500
113 static int do_statistics;
116 -static const struct option long_options[] =
117 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
119 { "alignment", required_argument, NULL, 'a' },
120 { "check", no_argument, NULL, 'c' },
121 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msggrep.c gettext-tools/src/msggrep.c
122 --- gettext-tools/src/msggrep.c 2005-05-20 16:41:05.000000000 -0400
123 +++ gettext-tools/src/msggrep.c 2005-11-11 11:03:39.796875000 -0500
125 static struct grep_task grep_task[3];
128 -static const struct option long_options[] =
129 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
131 { "add-location", no_argument, &line_comment, 1 },
132 { "comment", no_argument, NULL, 'C' },
133 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msginit.c gettext-tools/src/msginit.c
134 --- gettext-tools/src/msginit.c 2005-11-11 00:59:01.000000000 -0500
135 +++ gettext-tools/src/msginit.c 2005-11-11 11:04:42.078125000 -0500
137 static bool no_translator;
140 -static const struct option long_options[] =
141 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
143 { "help", no_argument, NULL, 'h' },
144 { "input", required_argument, NULL, 'i' },
145 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgmerge.c gettext-tools/src/msgmerge.c
146 --- gettext-tools/src/msgmerge.c 2005-05-20 16:42:09.000000000 -0400
147 +++ gettext-tools/src/msgmerge.c 2005-11-11 11:04:51.328125000 -0500
149 static const char *backup_suffix_string;
152 -static const struct option long_options[] =
153 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
155 { "add-location", no_argument, &line_comment, 1 },
156 { "backup", required_argument, NULL, CHAR_MAX + 1 },
157 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msgunfmt.c gettext-tools/src/msgunfmt.c
158 --- gettext-tools/src/msgunfmt.c 2005-05-20 16:42:11.000000000 -0400
159 +++ gettext-tools/src/msgunfmt.c 2005-11-11 11:05:45.718750000 -0500
164 -static const struct option long_options[] =
165 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
167 { "csharp", no_argument, NULL, CHAR_MAX + 4 },
168 { "csharp-resources", no_argument, NULL, CHAR_MAX + 5 },
169 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/msguniq.c gettext-tools/src/msguniq.c
170 --- gettext-tools/src/msguniq.c 2005-05-20 16:42:23.000000000 -0400
171 +++ gettext-tools/src/msguniq.c 2005-11-11 11:05:57.968750000 -0500
173 static const char *to_code;
176 -static const struct option long_options[] =
177 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
179 { "add-location", no_argument, &line_comment, 1 },
180 { "directory", required_argument, NULL, 'D' },
181 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/urlget.c gettext-tools/src/urlget.c
182 --- gettext-tools/src/urlget.c 2005-05-20 16:44:41.000000000 -0400
183 +++ gettext-tools/src/urlget.c 2005-11-11 11:06:10.968750000 -0500
188 -static const struct option long_options[] =
189 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
191 { "help", no_argument, NULL, 'h' },
192 { "version", no_argument, NULL, 'V' },
193 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/src/xgettext.c gettext-tools/src/xgettext.c
194 --- gettext-tools/src/xgettext.c 2005-05-20 16:47:42.000000000 -0400
195 +++ gettext-tools/src/xgettext.c 2005-11-11 11:06:25.406250000 -0500
200 -static const struct option long_options[] =
201 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
203 { "add-comments", optional_argument, NULL, 'c' },
204 { "add-location", no_argument, &line_comment, 1 },
205 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/tests/tstgettext.c gettext-tools/tests/tstgettext.c
206 --- gettext-tools/tests/tstgettext.c 2005-05-20 16:48:17.000000000 -0400
207 +++ gettext-tools/tests/tstgettext.c 2005-11-11 11:10:29.046875000 -0500
209 static bool do_expand;
212 -static const struct option long_options[] =
213 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
215 { "domain", required_argument, NULL, 'd' },
216 { "env", required_argument, NULL, '=' },
217 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/tests/tstngettext.c gettext-tools/tests/tstngettext.c
218 --- gettext-tools/tests/tstngettext.c 2005-05-20 16:48:20.000000000 -0400
219 +++ gettext-tools/tests/tstngettext.c 2005-11-11 11:10:39.875000000 -0500
221 #define _(str) gettext (str)
224 -static const struct option long_options[] =
225 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
227 { "domain", required_argument, NULL, 'd' },
228 { "env", required_argument, NULL, '=' },
229 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-runtime/configure.ac gettext-runtime/configure.ac
230 --- gettext-runtime/configure.ac 2005-11-11 00:04:26.000000000 -0500
231 +++ gettext-runtime/configure.ac 2005-11-11 11:34:46.687500000 -0500
236 +dnl Since gcc-3.3.3, const variables are placed in .rdata section
237 +dnl On windows (cygwin, mingw) this is a problem if the variable
238 +dnl is a composite containing references to other variables, because
239 +dnl the runtime relocation machinery can't fixup the address. Thus
240 +dnl these composite vars must NOT be declared const. This typically
241 +dnl occurs in long_options structs, containing references to variables
242 +dnl that are the targets of an option flag.
244 + *cygwin* | *mingw* )
245 + AC_DEFINE([CONST_IS_PROBLEMATIC_WIN32], 1,
246 + [Define to 1 if structs-containing-references must not be declared const])
249 +AH_VERBATIM([DEF_CONST_PROBLEMATIC_WIN32],
250 +[/* On some platforms, structs-containing-references must not be declared const */
251 +#if defined CONST_IS_PROBLEMATIC_WIN32
252 +# define CONST_PROBLEMATIC_WIN32
254 +# define CONST_PROBLEMATIC_WIN32 const
258 AH_VERBATIM([DEF_OS2],
259 [/* Extra OS/2 (emx+gcc) defines. */
261 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-tools/configure.ac gettext-tools/configure.ac
262 --- gettext-tools/configure.ac 2005-11-11 00:26:09.000000000 -0500
263 +++ gettext-tools/configure.ac 2005-11-11 11:34:03.140625000 -0500
268 +dnl Since gcc-3.3.3, const variables are placed in .rdata section
269 +dnl On windows (cygwin, mingw) this is a problem if the variable
270 +dnl is a composite containing references to other variables, because
271 +dnl the runtime relocation machinery can't fixup the address. Thus
272 +dnl these composite vars must NOT be declared const. This typically
273 +dnl occurs in long_options structs, containing references to variables
274 +dnl that are the targets of an option flag.
276 + *cygwin* | *mingw* )
277 + AC_DEFINE([CONST_IS_PROBLEMATIC_WIN32], 1,
278 + [Define to 1 if structs-containing-references must not be declared const])
281 +AH_VERBATIM([DEF_CONST_PROBLEMATIC_WIN32],
282 +[/* On some platforms, structs-containing-references must not be declared const */
283 +#if defined CONST_IS_PROBLEMATIC_WIN32
284 +# define CONST_PROBLEMATIC_WIN32
286 +# define CONST_PROBLEMATIC_WIN32 const
290 dnl Check for the expat XML parser.
291 dnl On operating systems where binary distribution vendors are likely to
292 dnl ship both gettext and expat, we use dynamic loading to avoid a hard
293 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-runtime/src/envsubst.c gettext-runtime/src/envsubst.c
294 --- gettext-runtime/src/envsubst.c 2005-05-20 16:14:16.000000000 -0400
295 +++ gettext-runtime/src/envsubst.c 2005-11-11 11:07:50.796875000 -0500
297 static bool all_variables;
300 -static const struct option long_options[] =
301 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
303 { "help", no_argument, NULL, 'h' },
304 { "variables", no_argument, NULL, 'v' },
305 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-runtime/src/gettext.c gettext-runtime/src/gettext.c
306 --- gettext-runtime/src/gettext.c 2005-05-20 16:14:21.000000000 -0400
307 +++ gettext-runtime/src/gettext.c 2005-11-11 11:08:03.859375000 -0500
309 static bool do_expand;
312 -static const struct option long_options[] =
313 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
315 { "domain", required_argument, NULL, 'd' },
316 { "help", no_argument, NULL, 'h' },
317 diff -urN -x .build -x .inst -x .sinst -x '*~' gettext-runtime/src/ngettext.c gettext-runtime/src/ngettext.c
318 --- gettext-runtime/src/ngettext.c 2005-05-20 16:14:39.000000000 -0400
319 +++ gettext-runtime/src/ngettext.c 2005-11-11 11:08:16.062500000 -0500
321 static int do_expand;
324 -static const struct option long_options[] =
325 +static CONST_PROBLEMATIC_WIN32 struct option long_options[] =
327 { "domain", required_argument, NULL, 'd' },
328 { "help", no_argument, NULL, 'h' },