Implement the %F directive if the system doesn't implement it correctly.
[gnulib.git] / m4 / printf.m4
1 # printf.m4 serial 6
2 dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
8 dnl 'L' size specifiers. (ISO C99, POSIX:2001)
9 dnl Result is gl_cv_func_printf_sizes_c99.
10
11 AC_DEFUN([gl_PRINTF_SIZES_C99],
12 [
13   AC_REQUIRE([AC_PROG_CC])
14   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
15   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
16   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
17   AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
18     [gl_cv_func_printf_sizes_c99], 
19     [
20       AC_TRY_RUN([
21 #include <stddef.h>
22 #include <stdio.h>
23 #include <string.h>
24 #include <sys/types.h>
25 #if HAVE_STDINT_H_WITH_UINTMAX
26 # include <stdint.h>
27 #endif
28 #if HAVE_INTTYPES_H_WITH_UINTMAX
29 # include <inttypes.h>
30 #endif
31 static char buf[100];
32 int main ()
33 {
34 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
35   buf[0] = '\0';
36   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
37       || strcmp (buf, "12345671 33") != 0)
38     return 1;
39 #endif
40   buf[0] = '\0';
41   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
42       || strcmp (buf, "12345672 33") != 0)
43     return 1;
44   buf[0] = '\0';
45   if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
46       || strcmp (buf, "12345673 33") != 0)
47     return 1;
48   buf[0] = '\0';
49   if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
50       || strcmp (buf, "1.5 33") != 0)
51     return 1;
52   return 0;
53 }], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
54       [
55 changequote(,)dnl
56        case "$host_os" in
57                                # Guess yes on glibc systems.
58          *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
59                                # Guess yes on FreeBSD >= 5.
60          freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
61          freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
62                                # Guess yes on MacOS X >= 10.3.
63          darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
64          darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
65                                # Guess yes on OpenBSD >= 3.9.
66          openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
67                                gl_cv_func_printf_sizes_c99="guessing no";;
68          openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
69                                # Guess yes on Solaris >= 2.10.
70          solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
71          solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
72                                # Guess yes on NetBSD >= 3.
73          netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
74                                gl_cv_func_printf_sizes_c99="guessing no";;
75          netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
76                                # If we don't know, assume the worst.
77          *)                    gl_cv_func_printf_sizes_c99="guessing no";;
78        esac
79 changequote([,])dnl
80       ])
81     ])
82 ])
83
84 dnl Test whether the *printf family of functions supports the 'a' and 'A'
85 dnl conversion specifier for hexadecimal output of floating-point numbers.
86 dnl (ISO C99, POSIX:2001)
87 dnl Result is gl_cv_func_printf_directive_a.
88
89 AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
90 [
91   AC_REQUIRE([AC_PROG_CC])
92   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
93   AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
94     [gl_cv_func_printf_directive_a], 
95     [
96       AC_TRY_RUN([
97 #include <stdio.h>
98 #include <string.h>
99 static char buf[100];
100 int main ()
101 {
102   if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
103       || (strcmp (buf, "0x1.922p+1 33") != 0
104           && strcmp (buf, "0x3.244p+0 33") != 0
105           && strcmp (buf, "0x6.488p-1 33") != 0
106           && strcmp (buf, "0xc.91p-2 33") != 0))
107     return 1;
108   if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
109       || (strcmp (buf, "-0X1.922P+1 33") != 0
110           && strcmp (buf, "-0X3.244P+0 33") != 0
111           && strcmp (buf, "-0X6.488P-1 33") != 0
112           && strcmp (buf, "-0XC.91P-2 33") != 0))
113     return 1;
114   /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
115   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
116       || (strcmp (buf, "0x1.83p+0 33") != 0
117           && strcmp (buf, "0x3.05p-1 33") != 0
118           && strcmp (buf, "0x6.0ap-2 33") != 0
119           && strcmp (buf, "0xc.14p-3 33") != 0))
120     return 1;
121   /* This catches a FreeBSD 6.1 bug.  See
122      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
123   if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
124       || buf[0] == '0')
125     return 1;
126   /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
127   if (sprintf (buf, "%.1a", 1.999) < 0
128       || (strcmp (buf, "0x1.0p+1") != 0
129           && strcmp (buf, "0x2.0p+0") != 0
130           && strcmp (buf, "0x4.0p-1") != 0
131           && strcmp (buf, "0x8.0p-2") != 0))
132     return 1;
133   /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
134      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
135   if (sprintf (buf, "%.1La", 1.999L) < 0
136       || (strcmp (buf, "0x1.0p+1") != 0
137           && strcmp (buf, "0x2.0p+0") != 0
138           && strcmp (buf, "0x4.0p-1") != 0
139           && strcmp (buf, "0x8.0p-2") != 0))
140     return 1;
141   return 0;
142 }], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
143       [
144        case "$host_os" in
145                                # Guess yes on glibc >= 2.5 systems.
146          *-gnu*)
147            AC_EGREP_CPP([BZ2908], [
148              #include <features.h>
149              #ifdef __GNU_LIBRARY__
150               #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
151                BZ2908
152               #endif
153              #endif
154              ],
155              [gl_cv_func_printf_directive_a="guessing yes"],
156              [gl_cv_func_printf_directive_a="guessing no"])
157            ;;
158                                # If we don't know, assume the worst.
159          *)                    gl_cv_func_printf_directive_a="guessing no";;
160        esac
161       ])
162     ])
163 ])
164
165 dnl Test whether the *printf family of functions supports the %F format
166 dnl directive. (ISO C99, POSIX:2001)
167 dnl Result is gl_cv_func_printf_directive_f.
168
169 AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
170 [
171   AC_REQUIRE([AC_PROG_CC])
172   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
173   AC_CACHE_CHECK([whether printf supports the 'F' directive],
174     [gl_cv_func_printf_directive_f], 
175     [
176       AC_TRY_RUN([
177 #include <stdio.h>
178 #include <string.h>
179 static char buf[100];
180 int main ()
181 {
182   if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
183       || strcmp (buf, "1234567.000000 33") != 0)
184     return 1;
185   if (sprintf (buf, "%F", 1.0 / 0.0) < 0
186       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
187     return 1;
188   /* This catches a Cygwin 2007 bug.  */
189   if (sprintf (buf, "%.F", 1234.0) < 0
190       || strcmp (buf, "1234") != 0)
191     return 1;
192   return 0;
193 }], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
194       [
195        case "$host_os" in
196                                # If we don't know, assume the worst.
197          *)                    gl_cv_func_printf_directive_f="guessing no";;
198        esac
199       ])
200     ])
201 ])
202
203 dnl Test whether the *printf family of functions supports the %n format
204 dnl directive. (ISO C99, POSIX:2001)
205 dnl Result is gl_cv_func_printf_directive_n.
206
207 AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
208 [
209   AC_REQUIRE([AC_PROG_CC])
210   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
211   AC_CACHE_CHECK([whether printf supports the 'n' directive],
212     [gl_cv_func_printf_directive_n], 
213     [
214       AC_TRY_RUN([
215 #include <stdio.h>
216 #include <string.h>
217 static char buf[100];
218 int main ()
219 {
220   int count = -1;
221   if (sprintf (buf, "%d %n", 123, &count, 33, 44, 55) < 0
222       || strcmp (buf, "123 ") != 0
223       || count != 4)
224     return 1;
225   return 0;
226 }], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
227       [
228 changequote(,)dnl
229        case "$host_os" in
230          *)     gl_cv_func_printf_directive_n="guessing yes";;
231        esac
232 changequote([,])dnl
233       ])
234     ])
235 ])
236
237 dnl Test whether the *printf family of functions supports POSIX/XSI format
238 dnl strings with positions. (POSIX:2001)
239 dnl Result is gl_cv_func_printf_positions.
240
241 AC_DEFUN([gl_PRINTF_POSITIONS],
242 [
243   AC_REQUIRE([AC_PROG_CC])
244   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
245   AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
246     [gl_cv_func_printf_positions], 
247     [
248       AC_TRY_RUN([
249 #include <stdio.h>
250 #include <string.h>
251 /* The string "%2$d %1$d", with dollar characters protected from the shell's
252    dollar expansion (possibly an autoconf bug).  */
253 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
254 static char buf[100];
255 int main ()
256 {
257   sprintf (buf, format, 33, 55);
258   return (strcmp (buf, "55 33") != 0);
259 }], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
260       [
261 changequote(,)dnl
262        case "$host_os" in
263          netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
264                        gl_cv_func_printf_positions="guessing no";;
265          beos*)        gl_cv_func_printf_positions="guessing no";;
266          mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
267          *)            gl_cv_func_printf_positions="guessing yes";;
268        esac
269 changequote([,])dnl
270       ])
271     ])
272 ])
273
274 dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
275 dnl Result is ac_cv_func_snprintf.
276
277 AC_DEFUN([gl_SNPRINTF_PRESENCE],
278 [
279   AC_CHECK_FUNCS_ONCE([snprintf])
280 ])
281
282 dnl Test whether the string produced by the snprintf function is always NUL
283 dnl terminated. (ISO C99, POSIX:2001)
284 dnl Result is gl_cv_func_snprintf_truncation_c99.
285
286 AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
287 [
288   AC_REQUIRE([AC_PROG_CC])
289   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
290   AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
291     [gl_cv_func_snprintf_truncation_c99], 
292     [
293       AC_TRY_RUN([
294 #include <stdio.h>
295 #include <string.h>
296 static char buf[100];
297 int main ()
298 {
299   strcpy (buf, "ABCDEF");
300   snprintf (buf, 3, "%d %d", 4567, 89);
301   if (memcmp (buf, "45\0DEF", 6) != 0)
302     return 1;
303   return 0;
304 }], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
305       [
306 changequote(,)dnl
307        case "$host_os" in
308                                # Guess yes on glibc systems.
309          *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
310                                # Guess yes on FreeBSD >= 5.
311          freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
312          freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
313                                # Guess yes on MacOS X >= 10.3.
314          darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
315          darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
316                                # Guess yes on OpenBSD >= 3.9.
317          openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
318                                gl_cv_func_snprintf_truncation_c99="guessing no";;
319          openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
320                                # Guess yes on Solaris >= 2.6.
321          solaris2.[0-5]*)      gl_cv_func_snprintf_truncation_c99="guessing no";;
322          solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
323                                # Guess yes on AIX >= 4.
324          aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
325          aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
326                                # Guess yes on HP-UX >= 11.
327          hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
328          hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
329                                # Guess yes on IRIX >= 6.5.
330          irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
331                                # Guess yes on OSF/1 >= 5.
332          osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
333          osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
334                                # Guess yes on NetBSD >= 3.
335          netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
336                                gl_cv_func_snprintf_truncation_c99="guessing no";;
337          netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
338                                # Guess yes on BeOS.
339          beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
340                                # If we don't know, assume the worst.
341          *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
342        esac
343 changequote([,])dnl
344       ])
345     ])
346 ])
347
348 dnl Test whether the return value of the snprintf function is the number
349 dnl of bytes (excluding the terminating NUL) that would have been produced
350 dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
351 dnl Result is gl_cv_func_snprintf_retval_c99.
352
353 AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
354 [
355   AC_REQUIRE([AC_PROG_CC])
356   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
357   AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
358     [gl_cv_func_snprintf_retval_c99], 
359     [
360       AC_TRY_RUN([
361 #include <stdio.h>
362 #include <string.h>
363 static char buf[100];
364 int main ()
365 {
366   strcpy (buf, "ABCDEF");
367   if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
368     return 1;
369   return 0;
370 }], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
371       [
372 changequote(,)dnl
373        case "$host_os" in
374                                # Guess yes on glibc systems.
375          *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
376                                # Guess yes on FreeBSD >= 5.
377          freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
378          freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
379                                # Guess yes on MacOS X >= 10.3.
380          darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
381          darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
382                                # Guess yes on OpenBSD >= 3.9.
383          openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
384                                gl_cv_func_snprintf_retval_c99="guessing no";;
385          openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
386                                # Guess yes on Solaris >= 2.6.
387          solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
388          solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
389                                # Guess yes on AIX >= 4.
390          aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
391          aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
392                                # Guess yes on NetBSD >= 3.
393          netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
394                                gl_cv_func_snprintf_retval_c99="guessing no";;
395          netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
396                                # Guess yes on BeOS.
397          beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
398                                # If we don't know, assume the worst.
399          *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
400        esac
401 changequote([,])dnl
402       ])
403     ])
404 ])
405
406 dnl Test whether the snprintf function supports the %n format directive
407 dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
408 dnl Result is gl_cv_func_snprintf_directive_n.
409
410 AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
411 [
412   AC_REQUIRE([AC_PROG_CC])
413   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
414   AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
415     [gl_cv_func_snprintf_directive_n], 
416     [
417       AC_TRY_RUN([
418 #include <stdio.h>
419 #include <string.h>
420 static char buf[100];
421 int main ()
422 {
423   int count = -1;
424   snprintf (buf, 4, "%d %n", 12345, &count, 33, 44, 55);
425   if (count != 6)
426     return 1;
427   return 0;
428 }], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
429       [
430 changequote(,)dnl
431        case "$host_os" in
432                                # Guess yes on glibc systems.
433          *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
434                                # Guess yes on FreeBSD >= 5.
435          freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing no";;
436          freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
437                                # Guess yes on MacOS X >= 10.3.
438          darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
439          darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
440                                # Guess yes on Solaris >= 2.6.
441          solaris2.[0-5]*)      gl_cv_func_snprintf_directive_n="guessing no";;
442          solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
443                                # Guess yes on AIX >= 4.
444          aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
445          aix*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
446                                # Guess yes on IRIX >= 6.5.
447          irix6.5)              gl_cv_func_snprintf_directive_n="guessing yes";;
448                                # Guess yes on OSF/1 >= 5.
449          osf[3-4]*)            gl_cv_func_snprintf_directive_n="guessing no";;
450          osf*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
451                                # Guess yes on NetBSD >= 3.
452          netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
453                                gl_cv_func_snprintf_directive_n="guessing no";;
454          netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
455                                # Guess yes on BeOS.
456          beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
457                                # If we don't know, assume the worst.
458          *)                    gl_cv_func_snprintf_directive_n="guessing no";;
459        esac
460 changequote([,])dnl
461       ])
462     ])
463 ])
464
465 dnl The results of these tests on various platforms are:
466 dnl
467 dnl 1 = gl_PRINTF_SIZES_C99
468 dnl 2 = gl_PRINTF_DIRECTIVE_A
469 dnl 3 = gl_PRINTF_DIRECTIVE_F
470 dnl 4 = gl_PRINTF_DIRECTIVE_N
471 dnl 5 = gl_PRINTF_POSITIONS
472 dnl 6 = gl_SNPRINTF_PRESENCE
473 dnl 7 = gl_SNPRINTF_TRUNCATION_C99
474 dnl 8 = gl_SNPRINTF_RETVAL_C99
475 dnl 9 = gl_SNPRINTF_DIRECTIVE_N
476 dnl
477 dnl 1 = checking whether printf supports size specifiers as in C99...
478 dnl 2 = checking whether printf supports the 'a' and 'A' directives...
479 dnl 3 = checking whether printf supports the 'F' directive...
480 dnl 4 = checking whether printf supports the 'n' directive...
481 dnl 5 = checking whether printf supports POSIX/XSI format strings with positions...
482 dnl 6 = checking for snprintf...
483 dnl 7 = checking whether snprintf truncates the result as in C99...
484 dnl 8 = checking whether snprintf returns a byte count as in C99...
485 dnl 9 = checking whether snprintf fully supports the 'n' directive...
486 dnl
487 dnl . = yes, # = no.
488 dnl
489 dnl                                        1  2  3  4  5  6  7  8  9
490 dnl   glibc 2.5                            .  .  .  .  .  .  .  .  .
491 dnl   glibc 2.3.6                          .  #  .  .  .  .  .  .  .
492 dnl   FreeBSD 5.4, 6.1                     .  ?  .  .  .  .  .  .  .
493 dnl   MacOS X 10.3.9                       .  #  .  .  .  .  .  .  .
494 dnl   OpenBSD 3.9, 4.0                     .  #  ?  .  .  .  .  .  ?
495 dnl   Cygwin 2007                          .  #  #  .  .  .  .  .  ?
496 dnl   Cygwin 2006                          #  #  #  .  .  .  .  .  ?
497 dnl   Solaris 10                           .  #  .  .  .  .  .  .  .
498 dnl   Solaris 2.6 ... 9                    #  #  #  .  .  .  .  .  .
499 dnl   Solaris 2.5.1                        #  #  #  .  .  #  #  #  #
500 dnl   AIX 4.3.2, 5.1                       #  #  #  .  .  .  .  .  .
501 dnl   HP-UX 11.31                          .  #  .  .  .  .  .  #  #
502 dnl   HP-UX 10.20, 11.00, 11.11, 11.23     #  #  #  .  .  .  .  #  #
503 dnl   IRIX 6.5                             #  #  #  .  .  .  .  #  .
504 dnl   OSF/1 5.1                            #  #  #  .  .  .  .  #  .
505 dnl   OSF/1 4.0d                           #  #  #  .  .  #  #  #  #
506 dnl   NetBSD 4.0                           .  ?  ?  .  .  .  .  .  ?
507 dnl   NetBSD 3.0                           .  #  ?  .  #  .  .  .  .
508 dnl   BeOS                                 #  #  ?  .  #  .  .  .  .
509 dnl   mingw                                #  #  #  .  #  .  #  #  #