annotate m4/printf.m4 @ 435:8f33e95a3269 3.0

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