annotate m4/printf.m4 @ 424:6d87423a979b 3.0-beta2

Added tag 3.0-beta2 for changeset 079d43b6967b
author lost@l-w.ca
date Sun, 19 Sep 2010 01:55:26 -0600
parents 3c2e1f24cc7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
421
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1 # printf.m4 serial 33
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
2 dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
6
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
7 dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
8 dnl 'L' size specifiers. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
9 dnl Result is gl_cv_func_printf_sizes_c99.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
10
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
11 AC_DEFUN([gl_PRINTF_SIZES_C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
12 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
13 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
14 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
15 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
16 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
17 AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
18 [gl_cv_func_printf_sizes_c99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
19 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
20 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
21 #include <stddef.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
22 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
23 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
24 #include <sys/types.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
25 #if HAVE_STDINT_H_WITH_UINTMAX
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
26 # include <stdint.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
27 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
28 #if HAVE_INTTYPES_H_WITH_UINTMAX
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
29 # include <inttypes.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
30 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
31 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
32 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
33 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
34 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
35 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
36 if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
37 || strcmp (buf, "12345671 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
38 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
39 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
40 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
41 if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
42 || strcmp (buf, "12345672 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
43 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
44 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
45 if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
46 || strcmp (buf, "12345673 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
47 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
48 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
49 if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
50 || strcmp (buf, "1.5 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
51 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
52 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
53 }], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
54 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
55 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
56 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
57 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
58 *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
59 # Guess yes on FreeBSD >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
60 freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
61 freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
62 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
63 darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
64 darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
65 # Guess yes on OpenBSD >= 3.9.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
66 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
67 gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
68 openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
69 # Guess yes on Solaris >= 2.10.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
70 solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
71 solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
72 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
73 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
74 gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
75 netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
76 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
77 *) gl_cv_func_printf_sizes_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
78 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
79 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
80 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
81 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
82 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
83
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
84 dnl Test whether the *printf family of functions supports 'long double'
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
85 dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
86 dnl Result is gl_cv_func_printf_long_double.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
87
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
88 AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
89 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
90 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
91 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
92 AC_CACHE_CHECK([whether printf supports 'long double' arguments],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
93 [gl_cv_func_printf_long_double],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
94 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
95 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
96 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
97 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
98 static char buf[10000];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
99 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
100 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
101 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
102 if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
103 || strcmp (buf, "1.750000 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
104 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
105 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
106 if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
107 || strcmp (buf, "1.750000e+00 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
108 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
109 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
110 if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
111 || strcmp (buf, "1.75 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
112 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
113 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
114 }], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
115 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
116 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
117 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
118 beos*) gl_cv_func_printf_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
119 mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
120 *) gl_cv_func_printf_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
121 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
122 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
123 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
124 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
125 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
126
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
127 dnl Test whether the *printf family of functions supports infinite and NaN
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
128 dnl 'double' arguments and negative zero arguments in the %f, %e, %g
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
129 dnl directives. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
130 dnl Result is gl_cv_func_printf_infinite.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
131
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
132 AC_DEFUN([gl_PRINTF_INFINITE],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
133 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
134 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
135 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
136 AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
137 [gl_cv_func_printf_infinite],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
138 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
139 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
140 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
141 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
142 static int
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
143 strisnan (const char *string, size_t start_index, size_t end_index)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
144 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
145 if (start_index < end_index)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
146 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
147 if (string[start_index] == '-')
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
148 start_index++;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
149 if (start_index + 3 <= end_index
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
150 && memcmp (string + start_index, "nan", 3) == 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
151 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
152 start_index += 3;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
153 if (start_index == end_index
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
154 || (string[start_index] == '(' && string[end_index - 1] == ')'))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
155 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
156 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
157 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
158 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
159 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
160 static int
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
161 have_minus_zero ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
162 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
163 static double plus_zero = 0.0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
164 double minus_zero = - plus_zero;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
165 return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
166 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
167 static char buf[10000];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
168 static double zero = 0.0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
169 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
170 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
171 if (sprintf (buf, "%f", 1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
172 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
173 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
174 if (sprintf (buf, "%f", -1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
175 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
176 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
177 if (sprintf (buf, "%f", zero / zero) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
178 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
179 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
180 if (sprintf (buf, "%e", 1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
181 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
182 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
183 if (sprintf (buf, "%e", -1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
184 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
185 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
186 if (sprintf (buf, "%e", zero / zero) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
187 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
188 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
189 if (sprintf (buf, "%g", 1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
190 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
191 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
192 if (sprintf (buf, "%g", -1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
193 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
194 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
195 if (sprintf (buf, "%g", zero / zero) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
196 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
197 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
198 /* This test fails on HP-UX 10.20. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
199 if (have_minus_zero ())
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
200 if (sprintf (buf, "%g", - zero) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
201 || strcmp (buf, "-0") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
202 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
203 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
204 }], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
205 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
206 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
207 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
208 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
209 *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
210 # Guess yes on FreeBSD >= 6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
211 freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
212 freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
213 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
214 darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
215 darwin*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
216 # Guess yes on HP-UX >= 11.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
217 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
218 hpux*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
219 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
220 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
221 gl_cv_func_printf_infinite="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
222 netbsd*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
223 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
224 beos*) gl_cv_func_printf_infinite="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
225 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
226 *) gl_cv_func_printf_infinite="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
227 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
228 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
229 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
230 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
231 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
232
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
233 dnl Test whether the *printf family of functions supports infinite and NaN
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
234 dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
235 dnl Result is gl_cv_func_printf_infinite_long_double.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
236
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
237 AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
238 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
239 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
240 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
241 AC_REQUIRE([gl_BIGENDIAN])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
242 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
243 dnl The user can set or unset the variable gl_printf_safe to indicate
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
244 dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
245 if test -n "$gl_printf_safe"; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
246 AC_DEFINE([CHECK_PRINTF_SAFE], [1],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
247 [Define if you wish *printf() functions that have a safe handling of
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
248 non-IEEE-754 'long double' values.])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
249 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
250 case "$gl_cv_func_printf_long_double" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
251 *yes)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
252 AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
253 [gl_cv_func_printf_infinite_long_double],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
254 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
255 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
256 ]GL_NOCRASH[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
257 #include <float.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
258 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
259 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
260 static int
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
261 strisnan (const char *string, size_t start_index, size_t end_index)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
262 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
263 if (start_index < end_index)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
264 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
265 if (string[start_index] == '-')
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
266 start_index++;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
267 if (start_index + 3 <= end_index
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
268 && memcmp (string + start_index, "nan", 3) == 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
269 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
270 start_index += 3;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
271 if (start_index == end_index
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
272 || (string[start_index] == '(' && string[end_index - 1] == ')'))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
273 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
274 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
275 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
276 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
277 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
278 static char buf[10000];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
279 static long double zeroL = 0.0L;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
280 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
281 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
282 nocrash_init();
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
283 if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
284 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
285 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
286 if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
287 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
288 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
289 if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
290 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
291 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
292 if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
293 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
294 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
295 if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
296 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
297 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
298 if (sprintf (buf, "%Le", zeroL / zeroL) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
299 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
300 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
301 if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
302 || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
303 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
304 if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
305 || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
306 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
307 if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
308 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
309 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
310 #if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
311 /* Representation of an 80-bit 'long double' as an initializer for a sequence
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
312 of 'unsigned int' words. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
313 # ifdef WORDS_BIGENDIAN
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
314 # define LDBL80_WORDS(exponent,manthi,mantlo) \
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
315 { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
316 ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
317 (unsigned int) (mantlo) << 16 \
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
318 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
319 # else
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
320 # define LDBL80_WORDS(exponent,manthi,mantlo) \
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
321 { mantlo, manthi, exponent }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
322 # endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
323 { /* Quiet NaN. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
324 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
325 { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
326 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
327 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
328 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
329 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
330 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
331 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
332 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
333 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
334 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
335 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
336 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
337 /* Signalling NaN. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
338 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
339 { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
340 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
341 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
342 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
343 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
344 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
345 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
346 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
347 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
348 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
349 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
350 { /* Pseudo-NaN. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
351 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
352 { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
353 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
354 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
355 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
356 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
357 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
358 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
359 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
360 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
361 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
362 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
363 { /* Pseudo-Infinity. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
364 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
365 { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
366 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
367 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
368 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
369 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
370 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
371 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
372 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
373 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
374 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
375 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
376 { /* Pseudo-Zero. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
377 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
378 { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
379 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
380 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
381 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
382 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
383 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
384 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
385 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
386 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
387 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
388 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
389 { /* Unnormalized number. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
390 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
391 { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
392 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
393 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
394 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
395 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
396 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
397 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
398 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
399 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
400 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
401 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
402 { /* Pseudo-Denormal. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
403 static union { unsigned int word[4]; long double value; } x =
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
404 { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
405 if (sprintf (buf, "%Lf", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
406 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
407 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
408 if (sprintf (buf, "%Le", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
409 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
410 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
411 if (sprintf (buf, "%Lg", x.value) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
412 || !strisnan (buf, 0, strlen (buf)))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
413 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
414 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
415 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
416 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
417 }],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
418 [gl_cv_func_printf_infinite_long_double=yes],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
419 [gl_cv_func_printf_infinite_long_double=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
420 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
421 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
422 case "$host_cpu" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
423 # Guess no on ia64, x86_64, i386.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
424 ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
425 *)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
426 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
427 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
428 *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
429 # Guess yes on FreeBSD >= 6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
430 freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
431 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
432 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
433 darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
434 darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
435 # Guess yes on HP-UX >= 11.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
436 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
437 hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
438 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
439 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
440 gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
441 netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
442 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
443 *) gl_cv_func_printf_infinite_long_double="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
444 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
445 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
446 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
447 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
448 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
449 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
450 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
451 *)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
452 gl_cv_func_printf_infinite_long_double="irrelevant"
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
453 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
454 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
455 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
456
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
457 dnl Test whether the *printf family of functions supports the 'a' and 'A'
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
458 dnl conversion specifier for hexadecimal output of floating-point numbers.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
459 dnl (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
460 dnl Result is gl_cv_func_printf_directive_a.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
461
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
462 AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
463 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
464 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
465 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
466 AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
467 [gl_cv_func_printf_directive_a],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
468 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
469 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
470 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
471 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
472 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
473 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
474 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
475 if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
476 || (strcmp (buf, "0x1.922p+1 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
477 && strcmp (buf, "0x3.244p+0 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
478 && strcmp (buf, "0x6.488p-1 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
479 && strcmp (buf, "0xc.91p-2 33") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
480 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
481 if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
482 || (strcmp (buf, "-0X1.922P+1 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
483 && strcmp (buf, "-0X3.244P+0 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
484 && strcmp (buf, "-0X6.488P-1 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
485 && strcmp (buf, "-0XC.91P-2 33") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
486 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
487 /* This catches a FreeBSD 6.1 bug: it doesn't round. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
488 if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
489 || (strcmp (buf, "0x1.83p+0 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
490 && strcmp (buf, "0x3.05p-1 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
491 && strcmp (buf, "0x6.0ap-2 33") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
492 && strcmp (buf, "0xc.14p-3 33") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
493 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
494 /* This catches a FreeBSD 6.1 bug. See
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
495 <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
496 if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
497 || buf[0] == '0')
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
498 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
499 /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
500 if (sprintf (buf, "%.1a", 1.999) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
501 || (strcmp (buf, "0x1.0p+1") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
502 && strcmp (buf, "0x2.0p+0") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
503 && strcmp (buf, "0x4.0p-1") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
504 && strcmp (buf, "0x8.0p-2") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
505 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
506 /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
507 glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
508 if (sprintf (buf, "%.1La", 1.999L) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
509 || (strcmp (buf, "0x1.0p+1") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
510 && strcmp (buf, "0x2.0p+0") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
511 && strcmp (buf, "0x4.0p-1") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
512 && strcmp (buf, "0x8.0p-2") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
513 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
514 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
515 }], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
516 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
517 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
518 # Guess yes on glibc >= 2.5 systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
519 *-gnu*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
520 AC_EGREP_CPP([BZ2908], [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
521 #include <features.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
522 #ifdef __GNU_LIBRARY__
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
523 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
524 BZ2908
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
525 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
526 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
527 ],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
528 [gl_cv_func_printf_directive_a="guessing yes"],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
529 [gl_cv_func_printf_directive_a="guessing no"])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
530 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
531 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
532 *) gl_cv_func_printf_directive_a="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
533 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
534 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
535 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
536 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
537
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
538 dnl Test whether the *printf family of functions supports the %F format
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
539 dnl directive. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
540 dnl Result is gl_cv_func_printf_directive_f.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
541
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
542 AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
543 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
544 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
545 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
546 AC_CACHE_CHECK([whether printf supports the 'F' directive],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
547 [gl_cv_func_printf_directive_f],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
548 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
549 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
550 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
551 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
552 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
553 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
554 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
555 if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
556 || strcmp (buf, "1234567.000000 33") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
557 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
558 if (sprintf (buf, "%F", 1.0 / 0.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
559 || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
560 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
561 /* This catches a Cygwin 1.5.x bug. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
562 if (sprintf (buf, "%.F", 1234.0) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
563 || strcmp (buf, "1234") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
564 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
565 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
566 }], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
567 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
568 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
569 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
570 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
571 *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
572 # Guess yes on FreeBSD >= 6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
573 freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
574 freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
575 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
576 darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
577 darwin*) gl_cv_func_printf_directive_f="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
578 # Guess yes on Solaris >= 2.10.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
579 solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
580 solaris*) gl_cv_func_printf_directive_f="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
581 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
582 *) gl_cv_func_printf_directive_f="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
583 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
584 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
585 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
586 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
587 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
588
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
589 dnl Test whether the *printf family of functions supports the %n format
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
590 dnl directive. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
591 dnl Result is gl_cv_func_printf_directive_n.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
592
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
593 AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
594 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
595 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
596 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
597 AC_CACHE_CHECK([whether printf supports the 'n' directive],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
598 [gl_cv_func_printf_directive_n],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
599 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
600 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
601 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
602 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
603 static char fmtstring[10];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
604 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
605 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
606 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
607 int count = -1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
608 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
609 support %n in format strings in read-only memory but not in writable
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
610 memory. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
611 strcpy (fmtstring, "%d %n");
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
612 if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
613 || strcmp (buf, "123 ") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
614 || count != 4)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
615 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
616 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
617 }], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
618 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
619 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
620 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
621 *) gl_cv_func_printf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
622 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
623 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
624 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
625 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
626 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
627
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
628 dnl Test whether the *printf family of functions supports the %ls format
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
629 dnl directive and in particular, when a precision is specified, whether
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
630 dnl the functions stop converting the wide string argument when the number
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
631 dnl of bytes that have been produced by this conversion equals or exceeds
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
632 dnl the precision.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
633 dnl Result is gl_cv_func_printf_directive_ls.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
634
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
635 AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
636 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
637 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
638 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
639 AC_CACHE_CHECK([whether printf supports the 'ls' directive],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
640 [gl_cv_func_printf_directive_ls],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
641 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
642 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
643 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
644 <wchar.h>.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
645 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
646 included before <wchar.h>. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
647 #include <stddef.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
648 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
649 #include <time.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
650 #include <wchar.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
651 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
652 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
653 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
654 char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
655 /* Test whether %ls works at all.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
656 This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
657 Cygwin 1.5. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
658 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
659 static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
660 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
661 if (sprintf (buf, "%ls", wstring) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
662 || strcmp (buf, "abc") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
663 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
664 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
665 /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
666 assertion failure inside libc), but not on OpenBSD 4.0. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
667 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
668 static const wchar_t wstring[] = { 'a', 0 };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
669 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
670 if (sprintf (buf, "%ls", wstring) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
671 || strcmp (buf, "a") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
672 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
673 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
674 /* Test whether precisions in %ls are supported as specified in ISO C 99
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
675 section 7.19.6.1:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
676 "If a precision is specified, no more than that many bytes are written
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
677 (including shift sequences, if any), and the array shall contain a
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
678 null wide character if, to equal the multibyte character sequence
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
679 length given by the precision, the function would need to access a
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
680 wide character one past the end of the array."
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
681 This test fails on Solaris 10. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
682 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
683 static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
684 buf[0] = '\0';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
685 if (sprintf (buf, "%.2ls", wstring) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
686 || strcmp (buf, "ab") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
687 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
688 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
689 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
690 }], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
691 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
692 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
693 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
694 openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
695 irix*) gl_cv_func_printf_directive_ls="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
696 solaris*) gl_cv_func_printf_directive_ls="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
697 cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
698 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
699 *) gl_cv_func_printf_directive_ls="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
700 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
701 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
702 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
703 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
704 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
705
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
706 dnl Test whether the *printf family of functions supports POSIX/XSI format
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
707 dnl strings with positions. (POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
708 dnl Result is gl_cv_func_printf_positions.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
709
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
710 AC_DEFUN([gl_PRINTF_POSITIONS],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
711 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
712 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
713 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
714 AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
715 [gl_cv_func_printf_positions],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
716 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
717 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
718 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
719 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
720 /* The string "%2$d %1$d", with dollar characters protected from the shell's
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
721 dollar expansion (possibly an autoconf bug). */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
722 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
723 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
724 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
725 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
726 sprintf (buf, format, 33, 55);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
727 return (strcmp (buf, "55 33") != 0);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
728 }], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
729 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
730 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
731 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
732 netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
733 gl_cv_func_printf_positions="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
734 beos*) gl_cv_func_printf_positions="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
735 mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
736 *) gl_cv_func_printf_positions="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
737 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
738 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
739 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
740 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
741 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
742
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
743 dnl Test whether the *printf family of functions supports POSIX/XSI format
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
744 dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
745 dnl Result is gl_cv_func_printf_flag_grouping.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
746
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
747 AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
748 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
749 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
750 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
751 AC_CACHE_CHECK([whether printf supports the grouping flag],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
752 [gl_cv_func_printf_flag_grouping],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
753 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
754 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
755 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
756 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
757 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
758 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
759 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
760 if (sprintf (buf, "%'d %d", 1234567, 99) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
761 || buf[strlen (buf) - 1] != '9')
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
762 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
763 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
764 }], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
765 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
766 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
767 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
768 cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
769 netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
770 mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
771 *) gl_cv_func_printf_flag_grouping="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
772 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
773 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
774 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
775 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
776 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
777
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
778 dnl Test whether the *printf family of functions supports the - flag correctly.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
779 dnl (ISO C99.) See
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
780 dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
781 dnl Result is gl_cv_func_printf_flag_leftadjust.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
782
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
783 AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
784 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
785 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
786 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
787 AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
788 [gl_cv_func_printf_flag_leftadjust],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
789 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
790 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
791 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
792 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
793 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
794 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
795 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
796 /* Check that a '-' flag is not annihilated by a negative width. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
797 if (sprintf (buf, "a%-*sc", -3, "b") < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
798 || strcmp (buf, "ab c") != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
799 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
800 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
801 }],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
802 [gl_cv_func_printf_flag_leftadjust=yes],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
803 [gl_cv_func_printf_flag_leftadjust=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
804 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
805 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
806 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
807 # Guess yes on HP-UX 11.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
808 hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
809 # Guess no on HP-UX 10 and older.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
810 hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
811 # Guess yes otherwise.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
812 *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
813 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
814 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
815 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
816 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
817 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
818
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
819 dnl Test whether the *printf family of functions supports padding of non-finite
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
820 dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
821 dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
822 dnl Result is gl_cv_func_printf_flag_zero.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
823
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
824 AC_DEFUN([gl_PRINTF_FLAG_ZERO],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
825 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
826 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
827 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
828 AC_CACHE_CHECK([whether printf supports the zero flag correctly],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
829 [gl_cv_func_printf_flag_zero],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
830 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
831 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
832 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
833 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
834 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
835 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
836 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
837 if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
838 || (strcmp (buf, " inf") != 0
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
839 && strcmp (buf, " infinity") != 0))
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
840 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
841 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
842 }], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
843 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
844 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
845 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
846 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
847 *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
848 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
849 beos*) gl_cv_func_printf_flag_zero="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
850 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
851 *) gl_cv_func_printf_flag_zero="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
852 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
853 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
854 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
855 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
856 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
857
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
858 dnl Test whether the *printf family of functions supports large precisions.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
859 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
860 dnl floating-point or pointer output. On BeOS, precisions larger than 1044
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
861 dnl crash the program.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
862 dnl Result is gl_cv_func_printf_precision.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
863
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
864 AC_DEFUN([gl_PRINTF_PRECISION],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
865 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
866 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
867 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
868 AC_CACHE_CHECK([whether printf supports large precisions],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
869 [gl_cv_func_printf_precision],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
870 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
871 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
872 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
873 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
874 static char buf[5000];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
875 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
876 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
877 #ifdef __BEOS__
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
878 /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
879 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
880 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
881 if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
882 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
883 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
884 }], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
885 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
886 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
887 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
888 # Guess no only on native Win32 and BeOS systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
889 mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
890 beos*) gl_cv_func_printf_precision="guessing no" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
891 *) gl_cv_func_printf_precision="guessing yes" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
892 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
893 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
894 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
895 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
896 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
897
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
898 dnl Test whether the *printf family of functions recovers gracefully in case
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
899 dnl of an out-of-memory condition, or whether it crashes the entire program.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
900 dnl Result is gl_cv_func_printf_enomem.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
901
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
902 AC_DEFUN([gl_PRINTF_ENOMEM],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
903 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
904 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
905 AC_REQUIRE([gl_MULTIARCH])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
906 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
907 AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
908 [gl_cv_func_printf_enomem],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
909 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
910 gl_cv_func_printf_enomem="guessing no"
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
911 if test "$cross_compiling" = no; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
912 if test $APPLE_UNIVERSAL_BUILD = 0; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
913 AC_LANG_CONFTEST([AC_LANG_SOURCE([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
914 ]GL_NOCRASH[
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
915 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
916 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
917 #include <sys/types.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
918 #include <sys/time.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
919 #include <sys/resource.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
920 #include <errno.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
921 int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
922 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
923 struct rlimit limit;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
924 int ret;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
925 nocrash_init ();
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
926 /* Some printf implementations allocate temporary space with malloc. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
927 /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
928 #ifdef RLIMIT_DATA
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
929 if (getrlimit (RLIMIT_DATA, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
930 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
931 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
932 limit.rlim_max = 5000000;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
933 limit.rlim_cur = limit.rlim_max;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
934 if (setrlimit (RLIMIT_DATA, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
935 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
936 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
937 /* On Linux systems, malloc() is limited by RLIMIT_AS. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
938 #ifdef RLIMIT_AS
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
939 if (getrlimit (RLIMIT_AS, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
940 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
941 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
942 limit.rlim_max = 5000000;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
943 limit.rlim_cur = limit.rlim_max;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
944 if (setrlimit (RLIMIT_AS, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
945 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
946 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
947 /* Some printf implementations allocate temporary space on the stack. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
948 #ifdef RLIMIT_STACK
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
949 if (getrlimit (RLIMIT_STACK, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
950 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
951 if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
952 limit.rlim_max = 5000000;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
953 limit.rlim_cur = limit.rlim_max;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
954 if (setrlimit (RLIMIT_STACK, &limit) < 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
955 return 77;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
956 #endif
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
957 ret = printf ("%.5000000f", 1.0);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
958 return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
959 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
960 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
961 ])])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
962 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
963 (./conftest
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
964 result=$?
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
965 if test $result != 0 && test $result != 77; then result=1; fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
966 exit $result
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
967 ) >/dev/null 2>/dev/null
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
968 case $? in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
969 0) gl_cv_func_printf_enomem="yes" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
970 77) gl_cv_func_printf_enomem="guessing no" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
971 *) gl_cv_func_printf_enomem="no" ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
972 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
973 else
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
974 gl_cv_func_printf_enomem="guessing no"
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
975 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
976 rm -fr conftest*
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
977 else
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
978 dnl A universal build on Apple MacOS X platforms.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
979 dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
980 dnl But we need a configuration result that is valid in both modes.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
981 gl_cv_func_printf_enomem="guessing no"
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
982 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
983 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
984 if test "$gl_cv_func_printf_enomem" = "guessing no"; then
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
985 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
986 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
987 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
988 *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
989 # Guess yes on Solaris.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
990 solaris*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
991 # Guess yes on AIX.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
992 aix*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
993 # Guess yes on HP-UX/hppa.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
994 hpux*) case "$host_cpu" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
995 hppa*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
996 *) gl_cv_func_printf_enomem="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
997 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
998 ;;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
999 # Guess yes on IRIX.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1000 irix*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1001 # Guess yes on OSF/1.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1002 osf*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1003 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1004 beos*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1005 # Guess yes on Haiku.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1006 haiku*) gl_cv_func_printf_enomem="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1007 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1008 *) gl_cv_func_printf_enomem="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1009 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1010 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1011 fi
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1012 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1013 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1014
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1015 dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1016 dnl Result is ac_cv_func_snprintf.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1017
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1018 AC_DEFUN([gl_SNPRINTF_PRESENCE],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1019 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1020 AC_CHECK_FUNCS_ONCE([snprintf])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1021 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1022
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1023 dnl Test whether the string produced by the snprintf function is always NUL
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1024 dnl terminated. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1025 dnl Result is gl_cv_func_snprintf_truncation_c99.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1026
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1027 AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1028 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1029 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1030 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1031 AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1032 [gl_cv_func_snprintf_truncation_c99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1033 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1034 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1035 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1036 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1037 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1038 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1039 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1040 strcpy (buf, "ABCDEF");
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1041 snprintf (buf, 3, "%d %d", 4567, 89);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1042 if (memcmp (buf, "45\0DEF", 6) != 0)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1043 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1044 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1045 }], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1046 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1047 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1048 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1049 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1050 *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1051 # Guess yes on FreeBSD >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1052 freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1053 freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1054 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1055 darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1056 darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1057 # Guess yes on OpenBSD >= 3.9.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1058 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1059 gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1060 openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1061 # Guess yes on Solaris >= 2.6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1062 solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1063 solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1064 # Guess yes on AIX >= 4.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1065 aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1066 aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1067 # Guess yes on HP-UX >= 11.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1068 hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1069 hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1070 # Guess yes on IRIX >= 6.5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1071 irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1072 # Guess yes on OSF/1 >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1073 osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1074 osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1075 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1076 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1077 gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1078 netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1079 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1080 beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1081 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1082 *) gl_cv_func_snprintf_truncation_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1083 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1084 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1085 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1086 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1087 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1088
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1089 dnl Test whether the return value of the snprintf function is the number
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1090 dnl of bytes (excluding the terminating NUL) that would have been produced
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1091 dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1092 dnl For example, this test program fails on IRIX 6.5:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1093 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1094 dnl #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1095 dnl int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1096 dnl {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1097 dnl static char buf[8];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1098 dnl int retval = snprintf (buf, 3, "%d", 12345);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1099 dnl return retval >= 0 && retval < 3;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1100 dnl }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1101 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1102 dnl Result is gl_cv_func_snprintf_retval_c99.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1103
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1104 AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1105 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1106 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1107 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1108 AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1109 [gl_cv_func_snprintf_retval_c99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1110 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1111 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1112 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1113 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1114 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1115 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1116 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1117 strcpy (buf, "ABCDEF");
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1118 if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1119 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1120 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1121 }], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1122 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1123 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1124 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1125 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1126 *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1127 # Guess yes on FreeBSD >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1128 freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1129 freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1130 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1131 darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1132 darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1133 # Guess yes on OpenBSD >= 3.9.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1134 openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1135 gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1136 openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1137 # Guess yes on Solaris >= 2.6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1138 solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1139 solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1140 # Guess yes on AIX >= 4.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1141 aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1142 aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1143 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1144 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1145 gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1146 netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1147 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1148 beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1149 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1150 *) gl_cv_func_snprintf_retval_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1151 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1152 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1153 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1154 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1155 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1156
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1157 dnl Test whether the snprintf function supports the %n format directive
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1158 dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1159 dnl Result is gl_cv_func_snprintf_directive_n.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1160
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1161 AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1162 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1163 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1164 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1165 AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1166 [gl_cv_func_snprintf_directive_n],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1167 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1168 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1169 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1170 #include <string.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1171 static char fmtstring[10];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1172 static char buf[100];
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1173 int main ()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1174 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1175 int count = -1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1176 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1177 support %n in format strings in read-only memory but not in writable
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1178 memory. */
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1179 strcpy (fmtstring, "%d %n");
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1180 snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1181 if (count != 6)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1182 return 1;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1183 return 0;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1184 }], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1185 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1186 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1187 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1188 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1189 *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1190 # Guess yes on FreeBSD >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1191 freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1192 freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1193 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1194 darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1195 darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1196 # Guess yes on Solaris >= 2.6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1197 solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1198 solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1199 # Guess yes on AIX >= 4.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1200 aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1201 aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1202 # Guess yes on IRIX >= 6.5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1203 irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1204 # Guess yes on OSF/1 >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1205 osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1206 osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1207 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1208 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1209 gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1210 netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1211 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1212 beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1213 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1214 *) gl_cv_func_snprintf_directive_n="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1215 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1216 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1217 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1218 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1219 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1220
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1221 dnl Test whether the snprintf function, when passed a size = 1, writes any
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1222 dnl output without bounds in this case, behaving like sprintf. This is the
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1223 dnl case on Linux libc5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1224 dnl Result is gl_cv_func_snprintf_size1.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1225
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1226 AC_DEFUN([gl_SNPRINTF_SIZE1],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1227 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1228 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1229 AC_CACHE_CHECK([whether snprintf respects a size of 1],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1230 [gl_cv_func_snprintf_size1],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1231 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1232 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1233 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1234 int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1235 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1236 static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1237 snprintf (buf, 1, "%d", 12345);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1238 return buf[1] != 'E';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1239 }],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1240 [gl_cv_func_snprintf_size1=yes],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1241 [gl_cv_func_snprintf_size1=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1242 [gl_cv_func_snprintf_size1="guessing yes"])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1243 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1244 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1245
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1246 dnl Test whether the vsnprintf function, when passed a zero size, produces no
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1247 dnl output. (ISO C99, POSIX:2001)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1248 dnl For example, snprintf nevertheless writes a NUL byte in this case
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1249 dnl on OSF/1 5.1:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1250 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1251 dnl #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1252 dnl int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1253 dnl {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1254 dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1255 dnl snprintf (buf, 0, "%d", 12345);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1256 dnl return buf[0] != 'D';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1257 dnl }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1258 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1259 dnl And vsnprintf writes any output without bounds in this case, behaving like
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1260 dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1261 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1262 dnl #include <stdarg.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1263 dnl #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1264 dnl static int my_snprintf (char *buf, int size, const char *format, ...)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1265 dnl {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1266 dnl va_list args;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1267 dnl int ret;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1268 dnl va_start (args, format);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1269 dnl ret = vsnprintf (buf, size, format, args);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1270 dnl va_end (args);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1271 dnl return ret;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1272 dnl }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1273 dnl int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1274 dnl {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1275 dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1276 dnl my_snprintf (buf, 0, "%d", 12345);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1277 dnl return buf[0] != 'D';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1278 dnl }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1279 dnl ---------------------------------------------------------------------
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1280 dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1281
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1282 AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1283 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1284 AC_REQUIRE([AC_PROG_CC])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1285 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1286 AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1287 [gl_cv_func_vsnprintf_zerosize_c99],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1288 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1289 AC_TRY_RUN([
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1290 #include <stdarg.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1291 #include <stdio.h>
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1292 static int my_snprintf (char *buf, int size, const char *format, ...)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1293 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1294 va_list args;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1295 int ret;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1296 va_start (args, format);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1297 ret = vsnprintf (buf, size, format, args);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1298 va_end (args);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1299 return ret;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1300 }
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1301 int main()
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1302 {
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1303 static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1304 my_snprintf (buf, 0, "%d", 12345);
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1305 return buf[0] != 'D';
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1306 }],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1307 [gl_cv_func_vsnprintf_zerosize_c99=yes],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1308 [gl_cv_func_vsnprintf_zerosize_c99=no],
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1309 [
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1310 changequote(,)dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1311 case "$host_os" in
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1312 # Guess yes on glibc systems.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1313 *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1314 # Guess yes on FreeBSD >= 5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1315 freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1316 freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1317 # Guess yes on MacOS X >= 10.3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1318 darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1319 darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1320 # Guess yes on Cygwin.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1321 cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1322 # Guess yes on Solaris >= 2.6.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1323 solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1324 solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1325 # Guess yes on AIX >= 4.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1326 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1327 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1328 # Guess yes on IRIX >= 6.5.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1329 irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1330 # Guess yes on NetBSD >= 3.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1331 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1332 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1333 netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1334 # Guess yes on BeOS.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1335 beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1336 # Guess yes on mingw.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1337 mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1338 # If we don't know, assume the worst.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1339 *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1340 esac
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1341 changequote([,])dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1342 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1343 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1344 ])
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1345
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1346 dnl The results of these tests on various platforms are:
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1347 dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1348 dnl 1 = gl_PRINTF_SIZES_C99
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1349 dnl 2 = gl_PRINTF_LONG_DOUBLE
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1350 dnl 3 = gl_PRINTF_INFINITE
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1351 dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1352 dnl 5 = gl_PRINTF_DIRECTIVE_A
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1353 dnl 6 = gl_PRINTF_DIRECTIVE_F
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1354 dnl 7 = gl_PRINTF_DIRECTIVE_N
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1355 dnl 8 = gl_PRINTF_DIRECTIVE_LS
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1356 dnl 9 = gl_PRINTF_POSITIONS
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1357 dnl 10 = gl_PRINTF_FLAG_GROUPING
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1358 dnl 11 = gl_PRINTF_FLAG_LEFTADJUST
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1359 dnl 12 = gl_PRINTF_FLAG_ZERO
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1360 dnl 13 = gl_PRINTF_PRECISION
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1361 dnl 14 = gl_PRINTF_ENOMEM
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1362 dnl 15 = gl_SNPRINTF_PRESENCE
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1363 dnl 16 = gl_SNPRINTF_TRUNCATION_C99
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1364 dnl 17 = gl_SNPRINTF_RETVAL_C99
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1365 dnl 18 = gl_SNPRINTF_DIRECTIVE_N
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1366 dnl 19 = gl_SNPRINTF_SIZE1
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1367 dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1368 dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1369 dnl 1 = checking whether printf supports size specifiers as in C99...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1370 dnl 2 = checking whether printf supports 'long double' arguments...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1371 dnl 3 = checking whether printf supports infinite 'double' arguments...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1372 dnl 4 = checking whether printf supports infinite 'long double' arguments...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1373 dnl 5 = checking whether printf supports the 'a' and 'A' directives...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1374 dnl 6 = checking whether printf supports the 'F' directive...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1375 dnl 7 = checking whether printf supports the 'n' directive...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1376 dnl 8 = checking whether printf supports the 'ls' directive...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1377 dnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1378 dnl 10 = checking whether printf supports the grouping flag...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1379 dnl 11 = checking whether printf supports the left-adjust flag correctly...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1380 dnl 12 = checking whether printf supports the zero flag correctly...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1381 dnl 13 = checking whether printf supports large precisions...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1382 dnl 14 = checking whether printf survives out-of-memory conditions...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1383 dnl 15 = checking for snprintf...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1384 dnl 16 = checking whether snprintf truncates the result as in C99...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1385 dnl 17 = checking whether snprintf returns a byte count as in C99...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1386 dnl 18 = checking whether snprintf fully supports the 'n' directive...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1387 dnl 19 = checking whether snprintf respects a size of 1...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1388 dnl 20 = checking whether vsnprintf respects a zero size as in C99...
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1389 dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1390 dnl . = yes, # = no.
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1391 dnl
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1392 dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1393 dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1394 dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1395 dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1396 dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1397 dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1398 dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1399 dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1400 dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1401 dnl Solaris 10 . . # # # . . # . . . # . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1402 dnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1403 dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1404 dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1405 dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1406 dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1407 dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1408 dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1409 dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1410 dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1411 dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1412 dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1413 dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1414 dnl Haiku . . . # # # . # . . . . . ? . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1415 dnl BeOS # # . # # # . ? # . ? . # ? . . . . . .
3c2e1f24cc7d Added generated files for release
lost@l-w.ca
parents:
diff changeset
1416 dnl mingw # # # # # # . . # # . # # ? . # # # . .