1 diff -Naurd mpfr-2.4.0-a/PATCHES mpfr-2.4.0-b/PATCHES
2 --- mpfr-2.4.0-a/PATCHES 2009-01-26 12:52:01.000000000 +0000
3 +++ mpfr-2.4.0-b/PATCHES 2009-02-20 17:27:44.000000000 +0000
6 diff -Naurd mpfr-2.4.0-a/VERSION mpfr-2.4.0-b/VERSION
7 --- mpfr-2.4.0-a/VERSION 2009-01-26 12:52:01.000000000 +0000
8 +++ mpfr-2.4.0-b/VERSION 2009-02-20 17:27:44.000000000 +0000
12 diff -Naurd mpfr-2.4.0-a/acinclude.m4 mpfr-2.4.0-b/acinclude.m4
13 --- mpfr-2.4.0-a/acinclude.m4 2009-01-26 12:52:01.000000000 +0000
14 +++ mpfr-2.4.0-b/acinclude.m4 2009-01-26 12:52:01.000000000 +0000
16 [AC_DEFINE([NPRINTF_J], 1, [gmp_printf cannot read intmax_t])])
19 +MPFR_FUNC_PRINTF_SPEC([%hhd], [char], [
22 + [AC_DEFINE([NPRINTF_HH], 1, [gmp_printf cannot use 'hh' length modifier])])
24 +MPFR_FUNC_PRINTF_SPEC([%lld], [long long int], [
27 + [AC_DEFINE([NPRINTF_LL], 1, [gmp_printf cannot read long long int])])
29 MPFR_FUNC_PRINTF_SPEC([%.0Lf], [long double], [
32 diff -Naurd mpfr-2.4.0-a/configure mpfr-2.4.0-b/configure
33 --- mpfr-2.4.0-a/configure 2009-01-26 12:54:36.000000000 +0000
34 +++ mpfr-2.4.0-b/configure 2009-02-20 17:38:36.000000000 +0000
35 @@ -24874,6 +24874,170 @@
39 +{ $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%hhd\"" >&5
40 +$as_echo_n "checking if gmp_printf supports \"%hhd\"... " >&6; }
41 +if test "$cross_compiling" = yes; then
42 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
43 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
44 +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
45 +See \`config.log' for more details." >&5
46 +$as_echo "$as_me: error: cannot run test program while cross compiling
47 +See \`config.log' for more details." >&2;}
48 + { (exit 1); exit 1; }; }; }
50 + cat >conftest.$ac_ext <<_ACEOF
53 +cat confdefs.h >>conftest.$ac_ext
54 +cat >>conftest.$ac_ext <<_ACEOF
55 +/* end confdefs.h. */
68 + return (gmp_sprintf (s, "%hhd", a) != 1) ? 1 : 0;
74 +rm -f conftest$ac_exeext
75 +if { (ac_try="$ac_link"
77 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
78 + *) ac_try_echo=$ac_try;;
80 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
81 +$as_echo "$ac_try_echo") >&5
82 + (eval "$ac_link") 2>&5
84 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
85 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
86 + { (case "(($ac_try" in
87 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
88 + *) ac_try_echo=$ac_try;;
90 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
91 +$as_echo "$ac_try_echo") >&5
92 + (eval "$ac_try") 2>&5
94 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
95 + (exit $ac_status); }; }; then
96 + { $as_echo "$as_me:$LINENO: result: yes" >&5
97 +$as_echo "yes" >&6; }
100 + $as_echo "$as_me: program exited with status $ac_status" >&5
101 +$as_echo "$as_me: failed program was:" >&5
102 +sed 's/^/| /' conftest.$ac_ext >&5
105 +{ $as_echo "$as_me:$LINENO: result: no" >&5
106 +$as_echo "no" >&6; }
108 +cat >>confdefs.h <<\_ACEOF
109 +#define NPRINTF_HH 1
113 +rm -rf conftest.dSYM
114 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
121 +{ $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%lld\"" >&5
122 +$as_echo_n "checking if gmp_printf supports \"%lld\"... " >&6; }
123 +if test "$cross_compiling" = yes; then
124 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
125 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
126 +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
127 +See \`config.log' for more details." >&5
128 +$as_echo "$as_me: error: cannot run test program while cross compiling
129 +See \`config.log' for more details." >&2;}
130 + { (exit 1); exit 1; }; }; }
132 + cat >conftest.$ac_ext <<_ACEOF
135 +cat confdefs.h >>conftest.$ac_ext
136 +cat >>conftest.$ac_ext <<_ACEOF
137 +/* end confdefs.h. */
149 + long long int a = 0;
150 + return (gmp_sprintf (s, "%lld", a) != 1) ? 1 : 0;
156 +rm -f conftest$ac_exeext
157 +if { (ac_try="$ac_link"
159 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
160 + *) ac_try_echo=$ac_try;;
162 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
163 +$as_echo "$ac_try_echo") >&5
164 + (eval "$ac_link") 2>&5
166 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
167 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
168 + { (case "(($ac_try" in
169 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
170 + *) ac_try_echo=$ac_try;;
172 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
173 +$as_echo "$ac_try_echo") >&5
174 + (eval "$ac_try") 2>&5
176 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
177 + (exit $ac_status); }; }; then
178 + { $as_echo "$as_me:$LINENO: result: yes" >&5
179 +$as_echo "yes" >&6; }
182 + $as_echo "$as_me: program exited with status $ac_status" >&5
183 +$as_echo "$as_me: failed program was:" >&5
184 +sed 's/^/| /' conftest.$ac_ext >&5
187 +{ $as_echo "$as_me:$LINENO: result: no" >&5
188 +$as_echo "no" >&6; }
190 +cat >>confdefs.h <<\_ACEOF
191 +#define NPRINTF_LL 1
195 +rm -rf conftest.dSYM
196 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
203 { $as_echo "$as_me:$LINENO: checking if gmp_printf supports \"%.0Lf\"" >&5
204 $as_echo_n "checking if gmp_printf supports \"%.0Lf\"... " >&6; }
205 if test "$cross_compiling" = yes; then
206 diff -Naurd mpfr-2.4.0-a/mpfr.h mpfr-2.4.0-b/mpfr.h
207 --- mpfr-2.4.0-a/mpfr.h 2009-01-26 12:52:01.000000000 +0000
208 +++ mpfr-2.4.0-b/mpfr.h 2009-02-20 17:27:44.000000000 +0000
210 #define MPFR_VERSION_MAJOR 2
211 #define MPFR_VERSION_MINOR 4
212 #define MPFR_VERSION_PATCHLEVEL 0
213 -#define MPFR_VERSION_STRING "2.4.0"
214 +#define MPFR_VERSION_STRING "2.4.0-p1"
216 /* Macros dealing with MPFR VERSION */
217 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
218 diff -Naurd mpfr-2.4.0-a/tests/tfprintf.c mpfr-2.4.0-b/tests/tfprintf.c
219 --- mpfr-2.4.0-a/tests/tfprintf.c 2009-01-26 12:52:00.000000000 +0000
220 +++ mpfr-2.4.0-b/tests/tfprintf.c 2009-02-20 16:31:02.000000000 +0000
223 unsigned short ush = 1;
228 unsigned long ulo = 1;
229 @@ -179,12 +180,11 @@
231 limb[0] = limb[1] = limb[2] = ~ (mp_limb_t) 0;
233 - check_vfprintf (fout, "a. %Ra, b. %hhu, c. %u, d. %lx%hhn", mpfr, uch, ui,
235 - check_length (1, uch, 28, hhu);
236 - check_vfprintf (fout, "a. %hhi, b. %Rb, c. %u, d. %li%ln", sch, mpfr, i,
237 + check_vfprintf (fout, "a. %Ra, b. %u, c. %lx%n", mpfr, ui, ulo, &j);
238 + check_length (1, j, 22, d);
239 + check_vfprintf (fout, "a. %c, b. %Rb, c. %u, d. %li%ln", i, mpfr, i,
241 - check_length (2, ulo, 37, lu);
242 + check_length (2, ulo, 36, lu);
243 check_vfprintf (fout, "a. %hi, b. %*f, c. %Re%hn", ush, 3, f, mpfr, &ush);
244 check_length (3, ush, 29, hu);
245 check_vfprintf (fout, "a. %hi, b. %f, c. %#.2Rf%n", sh, d, mpfr, &i);
246 @@ -208,13 +208,18 @@
247 check_length (9, sz, 30, zu);
251 + check_vfprintf (fout, "a. %hhi, b.%RA, c. %hhu%hhn", sch, mpfr, uch, &uch);
252 + check_length (10, uch, 21, hhu);
255 #if (__GNU_MP_VERSION * 10 + __GNU_MP_VERSION_MINOR) >= 42
256 /* The 'M' specifier was added in gmp 4.2.0 */
257 check_vfprintf (fout, "a. %Mx b. %Re%Mn", limb[0], mpfr, &limb[0]);
258 if (limb[0] != 14 + BITS_PER_MP_LIMB / 4 || limb[1] != ~ (mp_limb_t) 0
259 || limb[2] != ~ (mp_limb_t) 0)
261 - printf ("Error in test #10: mpfr_vfprintf did not print %d characters"
262 + printf ("Error in test #11: mpfr_vfprintf did not print %d characters"
263 " as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4);
266 @@ -227,13 +232,13 @@
267 if (limb[0] != 14 + 3 * BITS_PER_MP_LIMB / 4 || limb[1] != (mp_limb_t) 0
268 || limb[2] != ~ (mp_limb_t) 0)
270 - printf ("Error in test #11: mpfr_vfprintf did not print %d characters"
271 + printf ("Error in test #12: mpfr_vfprintf did not print %d characters"
272 " as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4);
277 -#ifdef HAVE_LONG_LONG
278 +#if defined(HAVE_LONG_LONG) && !defined(NPRINTF_LL)
281 unsigned long long ullo = 1;
282 diff -Naurd mpfr-2.4.0-a/tests/tprintf.c mpfr-2.4.0-b/tests/tprintf.c
283 --- mpfr-2.4.0-a/tests/tprintf.c 2009-01-26 12:52:00.000000000 +0000
284 +++ mpfr-2.4.0-b/tests/tprintf.c 2009-02-20 16:31:02.000000000 +0000
287 unsigned short ush = 1;
292 unsigned long ulo = 1;
293 @@ -178,11 +179,10 @@
294 mpfr_set_f (mpfr, mpf, GMP_RNDN);
295 prec = mpfr_get_prec (mpfr);
297 - check_vprintf ("a. %Ra, b. %hhu, c. %u, d. %lx%hhn", mpfr, uch, ui, ulo,
299 - check_length (1, uch, 28, hhu);
300 - check_vprintf ("a. %hhi, b. %Rb, c. %u, d. %li%ln", sch, mpfr, i, lo, &ulo);
301 - check_length (2, ulo, 37, lu);
302 + check_vprintf ("a. %Ra, b. %u, c. %lx%n", mpfr, ui, ulo, &j);
303 + check_length (1, j, 22, d);
304 + check_vprintf ("a. %c, b. %Rb, c. %u, d. %li%ln", i, mpfr, i, lo, &ulo);
305 + check_length (2, ulo, 36, lu);
306 check_vprintf ("a. %hi, b. %*f, c. %Re%hn", ush, 3, f, mpfr, &ush);
307 check_length (3, ush, 29, hu);
308 check_vprintf ("a. %hi, b. %f, c. %#.2Rf%n", sh, d, mpfr, &i);
310 check_length (9, sz, 30, zu);
313 -#ifdef HAVE_LONG_LONG
315 + check_vprintf ("a. %hhi, b. %Ra, c. %hhu%hhn", sch, mpfr, uch, &uch);
316 + check_length (10, uch, 22, hhu);
319 +#if defined(HAVE_LONG_LONG) && !defined(NPRINTF_LL)
322 unsigned long long ullo = 1;
323 diff -Naurd mpfr-2.4.0-a/vasprintf.c mpfr-2.4.0-b/vasprintf.c
324 --- mpfr-2.4.0-a/vasprintf.c 2009-01-26 12:52:01.000000000 +0000
325 +++ mpfr-2.4.0-b/vasprintf.c 2009-02-20 16:31:02.000000000 +0000
326 @@ -235,10 +235,14 @@
329 if (*++format == 'h')
333 specinfo->arg_type = CHAR_ARG;
336 + specinfo->arg_type = UNSUPPORTED;
339 specinfo->arg_type = SHORT_ARG;
342 if (*++format == 'l')
345 -#ifdef HAVE_LONG_LONG
346 +#if defined (HAVE_LONG_LONG) && !defined(NPRINTF_LL)
347 specinfo->arg_type = LONG_LONG_ARG;
349 specinfo->arg_type = UNSUPPORTED;
350 diff -Naurd mpfr-2.4.0-a/version.c mpfr-2.4.0-b/version.c
351 --- mpfr-2.4.0-a/version.c 2009-01-26 12:52:01.000000000 +0000
352 +++ mpfr-2.4.0-b/version.c 2009-02-20 17:27:44.000000000 +0000
355 mpfr_get_version (void)