wok-current view mpfr/stuff/mpfr-3.0.0-p4.patch @ rev 7196
Fix: ruby-gtk2: include Glade support for compatibility with Glade-created UIs. While still GTK-related, this is available only from the Ruby-GNOME source package, with no other implications.
author | Ben Arnold <ben@seawolfsanctuary.com> |
---|---|
date | Tue Nov 09 09:57:16 2010 +0000 (2010-11-09) |
parents | fe92c91d5083 |
children |
line source
1 diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
2 --- mpfr-3.0.0-a/PATCHES 2010-06-23 11:02:49.000000000 +0000
3 +++ mpfr-3.0.0-b/PATCHES 2010-06-23 11:03:36.000000000 +0000
4 @@ -0,0 +1 @@
5 +mpfr_out_str
6 diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
7 --- mpfr-3.0.0-a/VERSION 2010-06-10 11:00:14.000000000 +0000
8 +++ mpfr-3.0.0-b/VERSION 2010-06-23 11:03:20.000000000 +0000
9 @@ -1 +1 @@
10 -3.0.0
11 +3.0.0-p1
12 diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
13 --- mpfr-3.0.0-a/mpfr.h 2010-06-10 11:00:14.000000000 +0000
14 +++ mpfr-3.0.0-b/mpfr.h 2010-06-23 11:03:20.000000000 +0000
15 @@ -27,7 +27,7 @@
16 #define MPFR_VERSION_MAJOR 3
17 #define MPFR_VERSION_MINOR 0
18 #define MPFR_VERSION_PATCHLEVEL 0
19 -#define MPFR_VERSION_STRING "3.0.0"
20 +#define MPFR_VERSION_STRING "3.0.0-p1"
22 /* Macros dealing with MPFR VERSION */
23 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
24 diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
25 --- mpfr-3.0.0-a/mpfr.texi 2010-06-10 11:00:14.000000000 +0000
26 +++ mpfr-3.0.0-b/mpfr.texi 2010-06-23 11:03:12.000000000 +0000
27 @@ -2050,7 +2050,7 @@
28 are printed. If @var{base} is greater than 10, @samp{@@} will be used
29 instead of @samp{e} as exponent delimiter.
31 -Return the number of bytes written, or if an error occurred, return 0.
32 +Return the number of characters written, or if an error occurred, return 0.
33 @end deftypefun
35 @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
36 diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
37 --- mpfr-3.0.0-a/out_str.c 2010-06-10 11:00:14.000000000 +0000
38 +++ mpfr-3.0.0-b/out_str.c 2010-06-23 11:03:12.000000000 +0000
39 @@ -22,6 +22,16 @@
41 #include "mpfr-impl.h"
43 +/* Warning! S should not contain "%". */
44 +#define OUT_STR_RET(S) \
45 + do \
46 + { \
47 + int r; \
48 + r = fprintf (stream, (S)); \
49 + return r < 0 ? 0 : r; \
50 + } \
51 + while (0)
52 +
53 size_t
54 mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
55 mpfr_rnd_t rnd_mode)
56 @@ -29,6 +39,7 @@
57 char *s, *s0;
58 size_t l;
59 mpfr_exp_t e;
60 + int err;
62 MPFR_ASSERTN (base >= 2 && base <= 62);
64 @@ -36,37 +47,16 @@
65 if (stream == NULL)
66 stream = stdout;
68 - if (MPFR_IS_NAN(op))
69 - {
70 - fprintf (stream, "@NaN@");
71 - return 3;
72 - }
73 -
74 - if (MPFR_IS_INF(op))
75 - {
76 - if (MPFR_SIGN(op) > 0)
77 - {
78 - fprintf (stream, "@Inf@");
79 - return 3;
80 - }
81 - else
82 - {
83 - fprintf (stream, "-@Inf@");
84 - return 4;
85 - }
86 - }
87 -
88 - if (MPFR_IS_ZERO(op))
89 + if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
90 {
91 - if (MPFR_SIGN(op) > 0)
92 - {
93 - fprintf(stream, "0");
94 - return 1;
95 - }
96 + if (MPFR_IS_NAN (op))
97 + OUT_STR_RET ("@NaN@");
98 + else if (MPFR_IS_INF (op))
99 + OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
100 else
101 {
102 - fprintf(stream, "-0");
103 - return 2;
104 + MPFR_ASSERTD (MPFR_IS_ZERO (op));
105 + OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
106 }
107 }
109 @@ -77,21 +67,31 @@
111 l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
112 - may be incorrect, as only an upper bound? */
113 - if (*s == '-')
114 - fputc (*s++, stream);
116 - /* outputs mantissa */
117 - fputc (*s++, stream); e--; /* leading digit */
118 - fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
119 - fputs (s, stream); /* rest of mantissa */
120 + /* outputs possible sign and significand */
121 + err = (*s == '-' && fputc (*s++, stream) == EOF)
122 + || fputc (*s++, stream) == EOF /* leading digit */
123 + || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
124 + || fputs (s, stream) == EOF; /* trailing significand */
125 (*__gmp_free_func) (s0, l);
126 + if (MPFR_UNLIKELY (err))
127 + return 0;
128 +
129 + e--; /* due to the leading digit */
131 /* outputs exponent */
132 if (e)
133 {
134 + int r;
135 +
136 MPFR_ASSERTN(e >= LONG_MIN);
137 MPFR_ASSERTN(e <= LONG_MAX);
138 - l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
139 +
140 + r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
141 + if (MPFR_UNLIKELY (r < 0))
142 + return 0;
143 +
144 + l += r;
145 }
147 return l;
148 diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
149 --- mpfr-3.0.0-a/tests/tout_str.c 2010-06-10 11:00:13.000000000 +0000
150 +++ mpfr-3.0.0-b/tests/tout_str.c 2010-06-23 11:03:12.000000000 +0000
151 @@ -46,22 +46,54 @@
152 special (void)
153 {
154 mpfr_t x;
155 + unsigned int n;
157 mpfr_init (x);
159 mpfr_set_nan (x);
160 - mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
161 + n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
162 + if (n != 5)
163 + {
164 + printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
165 + "characters instead of 5.\n", n);
166 + exit (1);
167 + }
169 mpfr_set_inf (x, 1);
170 - mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
171 + n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
172 + if (n != 5)
173 + {
174 + printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
175 + "characters instead of 5.\n", n);
176 + exit (1);
177 + }
179 mpfr_set_inf (x, -1);
180 - mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
181 + n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
182 + if (n != 6)
183 + {
184 + printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
185 + "characters instead of 6.\n", n);
186 + exit (1);
187 + }
189 mpfr_set_ui (x, 0, MPFR_RNDN);
190 - mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
191 + n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
192 + if (n != 1)
193 + {
194 + printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
195 + "characters instead of 1.\n", n);
196 + exit (1);
197 + }
198 +
199 mpfr_neg (x, x, MPFR_RNDN);
200 - mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
201 + n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
202 + if (n != 2)
203 + {
204 + printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
205 + "characters instead of 2.\n", n);
206 + exit (1);
207 + }
209 mpfr_clear (x);
210 }
211 diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
212 --- mpfr-3.0.0-a/version.c 2010-06-10 11:00:14.000000000 +0000
213 +++ mpfr-3.0.0-b/version.c 2010-06-23 11:03:20.000000000 +0000
214 @@ -25,5 +25,5 @@
215 const char *
216 mpfr_get_version (void)
217 {
218 - return "3.0.0";
219 + return "3.0.0-p1";
220 }
221 diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
222 --- mpfr-3.0.0-a/Makefile.in 2010-06-10 11:00:52.000000000 +0000
223 +++ mpfr-3.0.0-b/Makefile.in 2010-06-10 11:00:52.000000000 +0000
224 @@ -239,6 +239,7 @@
225 distuninstallcheck_listfiles = find . -type f -print
226 distcleancheck_listfiles = find . -type f -print
227 ACLOCAL = @ACLOCAL@
228 +ALLOCA = @ALLOCA@
229 AMTAR = @AMTAR@
230 AR = @AR@
231 AS = @AS@
232 diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
233 --- mpfr-3.0.0-a/PATCHES 2010-06-23 11:03:36.000000000 +0000
234 +++ mpfr-3.0.0-b/PATCHES 2010-06-25 13:23:13.000000000 +0000
235 @@ -0,0 +1 @@
236 +alloca
237 diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
238 --- mpfr-3.0.0-a/VERSION 2010-06-23 11:03:20.000000000 +0000
239 +++ mpfr-3.0.0-b/VERSION 2010-06-25 13:23:13.000000000 +0000
240 @@ -1 +1 @@
241 -3.0.0-p1
242 +3.0.0-p2
243 diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
244 --- mpfr-3.0.0-a/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
245 +++ mpfr-3.0.0-b/acinclude.m4 2010-06-10 11:00:14.000000000 +0000
246 @@ -59,6 +59,9 @@
247 dnl sys/fpu.h - MIPS specific
248 AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
250 +dnl Check how to get `alloca'
251 +AC_FUNC_ALLOCA
252 +
253 dnl SIZE_MAX macro
254 gl_SIZE_MAX
256 diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
257 --- mpfr-3.0.0-a/configure 2010-06-10 11:00:51.000000000 +0000
258 +++ mpfr-3.0.0-b/configure 2010-06-25 13:23:05.000000000 +0000
259 @@ -783,6 +783,7 @@
260 OBJDUMP
261 DLLTOOL
262 AS
263 +ALLOCA
264 MPFR_LIBM
265 ANSI2KNR
266 U
267 @@ -5622,6 +5623,197 @@
268 done
271 +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
272 +# for constant arguments. Useless!
273 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
274 +$as_echo_n "checking for working alloca.h... " >&6; }
275 +if test "${ac_cv_working_alloca_h+set}" = set; then :
276 + $as_echo_n "(cached) " >&6
277 +else
278 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
279 +/* end confdefs.h. */
280 +#include <alloca.h>
281 +int
282 +main ()
283 +{
284 +char *p = (char *) alloca (2 * sizeof (int));
285 + if (p) return 0;
286 + ;
287 + return 0;
288 +}
289 +_ACEOF
290 +if ac_fn_c_try_link "$LINENO"; then :
291 + ac_cv_working_alloca_h=yes
292 +else
293 + ac_cv_working_alloca_h=no
294 +fi
295 +rm -f core conftest.err conftest.$ac_objext \
296 + conftest$ac_exeext conftest.$ac_ext
297 +fi
298 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
299 +$as_echo "$ac_cv_working_alloca_h" >&6; }
300 +if test $ac_cv_working_alloca_h = yes; then
301 +
302 +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
303 +
304 +fi
305 +
306 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
307 +$as_echo_n "checking for alloca... " >&6; }
308 +if test "${ac_cv_func_alloca_works+set}" = set; then :
309 + $as_echo_n "(cached) " >&6
310 +else
311 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
312 +/* end confdefs.h. */
313 +#ifdef __GNUC__
314 +# define alloca __builtin_alloca
315 +#else
316 +# ifdef _MSC_VER
317 +# include <malloc.h>
318 +# define alloca _alloca
319 +# else
320 +# ifdef HAVE_ALLOCA_H
321 +# include <alloca.h>
322 +# else
323 +# ifdef _AIX
324 + #pragma alloca
325 +# else
326 +# ifndef alloca /* predefined by HP cc +Olibcalls */
327 +char *alloca ();
328 +# endif
329 +# endif
330 +# endif
331 +# endif
332 +#endif
333 +
334 +int
335 +main ()
336 +{
337 +char *p = (char *) alloca (1);
338 + if (p) return 0;
339 + ;
340 + return 0;
341 +}
342 +_ACEOF
343 +if ac_fn_c_try_link "$LINENO"; then :
344 + ac_cv_func_alloca_works=yes
345 +else
346 + ac_cv_func_alloca_works=no
347 +fi
348 +rm -f core conftest.err conftest.$ac_objext \
349 + conftest$ac_exeext conftest.$ac_ext
350 +fi
351 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
352 +$as_echo "$ac_cv_func_alloca_works" >&6; }
353 +
354 +if test $ac_cv_func_alloca_works = yes; then
355 +
356 +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
357 +
358 +else
359 + # The SVR3 libPW and SVR4 libucb both contain incompatible functions
360 +# that cause trouble. Some versions do not even contain alloca or
361 +# contain a buggy version. If you still want to use their alloca,
362 +# use ar to extract alloca.o from them instead of compiling alloca.c.
363 +
364 +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
365 +
366 +$as_echo "#define C_ALLOCA 1" >>confdefs.h
367 +
368 +
369 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
370 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
371 +if test "${ac_cv_os_cray+set}" = set; then :
372 + $as_echo_n "(cached) " >&6
373 +else
374 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
375 +/* end confdefs.h. */
376 +#if defined CRAY && ! defined CRAY2
377 +webecray
378 +#else
379 +wenotbecray
380 +#endif
381 +
382 +_ACEOF
383 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
384 + $EGREP "webecray" >/dev/null 2>&1; then :
385 + ac_cv_os_cray=yes
386 +else
387 + ac_cv_os_cray=no
388 +fi
389 +rm -f conftest*
390 +
391 +fi
392 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
393 +$as_echo "$ac_cv_os_cray" >&6; }
394 +if test $ac_cv_os_cray = yes; then
395 + for ac_func in _getb67 GETB67 getb67; do
396 + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
397 +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
398 +eval as_val=\$$as_ac_var
399 + if test "x$as_val" = x""yes; then :
400 +
401 +cat >>confdefs.h <<_ACEOF
402 +#define CRAY_STACKSEG_END $ac_func
403 +_ACEOF
404 +
405 + break
406 +fi
407 +
408 + done
409 +fi
410 +
411 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
412 +$as_echo_n "checking stack direction for C alloca... " >&6; }
413 +if test "${ac_cv_c_stack_direction+set}" = set; then :
414 + $as_echo_n "(cached) " >&6
415 +else
416 + if test "$cross_compiling" = yes; then :
417 + ac_cv_c_stack_direction=0
418 +else
419 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
420 +/* end confdefs.h. */
421 +$ac_includes_default
422 +int
423 +find_stack_direction ()
424 +{
425 + static char *addr = 0;
426 + auto char dummy;
427 + if (addr == 0)
428 + {
429 + addr = &dummy;
430 + return find_stack_direction ();
431 + }
432 + else
433 + return (&dummy > addr) ? 1 : -1;
434 +}
435 +
436 +int
437 +main ()
438 +{
439 + return find_stack_direction () < 0;
440 +}
441 +_ACEOF
442 +if ac_fn_c_try_run "$LINENO"; then :
443 + ac_cv_c_stack_direction=1
444 +else
445 + ac_cv_c_stack_direction=-1
446 +fi
447 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
448 + conftest.$ac_objext conftest.beam conftest.$ac_ext
449 +fi
450 +
451 +fi
452 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
453 +$as_echo "$ac_cv_c_stack_direction" >&6; }
454 +cat >>confdefs.h <<_ACEOF
455 +#define STACK_DIRECTION $ac_cv_c_stack_direction
456 +_ACEOF
457 +
458 +
459 +fi
460 +
461 +
463 for ac_header in stdint.h
464 do :
465 @@ -7564,13 +7756,13 @@
466 else
467 lt_cv_nm_interface="BSD nm"
468 echo "int some_variable = 0;" > conftest.$ac_ext
469 - (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
470 + (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
471 (eval "$ac_compile" 2>conftest.err)
472 cat conftest.err >&5
473 - (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
474 + (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
475 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
476 cat conftest.err >&5
477 - (eval echo "\"\$as_me:7573: output\"" >&5)
478 + (eval echo "\"\$as_me:7765: output\"" >&5)
479 cat conftest.out >&5
480 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
481 lt_cv_nm_interface="MS dumpbin"
482 @@ -8772,7 +8964,7 @@
483 ;;
484 *-*-irix6*)
485 # Find out which ABI we are using.
486 - echo '#line 8775 "configure"' > conftest.$ac_ext
487 + echo '#line 8967 "configure"' > conftest.$ac_ext
488 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
489 (eval $ac_compile) 2>&5
490 ac_status=$?
491 @@ -10032,11 +10224,11 @@
492 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
493 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
494 -e 's:$: $lt_compiler_flag:'`
495 - (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
496 + (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
497 (eval "$lt_compile" 2>conftest.err)
498 ac_status=$?
499 cat conftest.err >&5
500 - echo "$as_me:10039: \$? = $ac_status" >&5
501 + echo "$as_me:10231: \$? = $ac_status" >&5
502 if (exit $ac_status) && test -s "$ac_outfile"; then
503 # The compiler can only warn and ignore the option if not recognized
504 # So say no if there are warnings other than the usual output.
505 @@ -10371,11 +10563,11 @@
506 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
507 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
508 -e 's:$: $lt_compiler_flag:'`
509 - (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
510 + (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
511 (eval "$lt_compile" 2>conftest.err)
512 ac_status=$?
513 cat conftest.err >&5
514 - echo "$as_me:10378: \$? = $ac_status" >&5
515 + echo "$as_me:10570: \$? = $ac_status" >&5
516 if (exit $ac_status) && test -s "$ac_outfile"; then
517 # The compiler can only warn and ignore the option if not recognized
518 # So say no if there are warnings other than the usual output.
519 @@ -10476,11 +10668,11 @@
520 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
521 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
522 -e 's:$: $lt_compiler_flag:'`
523 - (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
524 + (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
525 (eval "$lt_compile" 2>out/conftest.err)
526 ac_status=$?
527 cat out/conftest.err >&5
528 - echo "$as_me:10483: \$? = $ac_status" >&5
529 + echo "$as_me:10675: \$? = $ac_status" >&5
530 if (exit $ac_status) && test -s out/conftest2.$ac_objext
531 then
532 # The compiler can only warn and ignore the option if not recognized
533 @@ -10531,11 +10723,11 @@
534 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
535 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
536 -e 's:$: $lt_compiler_flag:'`
537 - (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
538 + (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
539 (eval "$lt_compile" 2>out/conftest.err)
540 ac_status=$?
541 cat out/conftest.err >&5
542 - echo "$as_me:10538: \$? = $ac_status" >&5
543 + echo "$as_me:10730: \$? = $ac_status" >&5
544 if (exit $ac_status) && test -s out/conftest2.$ac_objext
545 then
546 # The compiler can only warn and ignore the option if not recognized
547 @@ -12915,7 +13107,7 @@
548 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
549 lt_status=$lt_dlunknown
550 cat > conftest.$ac_ext <<_LT_EOF
551 -#line 12918 "configure"
552 +#line 13110 "configure"
553 #include "confdefs.h"
555 #if HAVE_DLFCN_H
556 @@ -13011,7 +13203,7 @@
557 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
558 lt_status=$lt_dlunknown
559 cat > conftest.$ac_ext <<_LT_EOF
560 -#line 13014 "configure"
561 +#line 13206 "configure"
562 #include "confdefs.h"
564 #if HAVE_DLFCN_H
565 diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
566 --- mpfr-3.0.0-a/mpfr.h 2010-06-23 11:03:20.000000000 +0000
567 +++ mpfr-3.0.0-b/mpfr.h 2010-06-25 13:23:13.000000000 +0000
568 @@ -27,7 +27,7 @@
569 #define MPFR_VERSION_MAJOR 3
570 #define MPFR_VERSION_MINOR 0
571 #define MPFR_VERSION_PATCHLEVEL 0
572 -#define MPFR_VERSION_STRING "3.0.0-p1"
573 +#define MPFR_VERSION_STRING "3.0.0-p2"
575 /* Macros dealing with MPFR VERSION */
576 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
577 diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
578 --- mpfr-3.0.0-a/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
579 +++ mpfr-3.0.0-b/tests/Makefile.in 2010-06-10 11:00:52.000000000 +0000
580 @@ -960,6 +960,7 @@
581 red=; grn=; lgn=; blu=; std=
582 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
583 ACLOCAL = @ACLOCAL@
584 +ALLOCA = @ALLOCA@
585 AMTAR = @AMTAR@
586 AR = @AR@
587 AS = @AS@
588 diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
589 --- mpfr-3.0.0-a/version.c 2010-06-23 11:03:20.000000000 +0000
590 +++ mpfr-3.0.0-b/version.c 2010-06-25 13:23:13.000000000 +0000
591 @@ -25,5 +25,5 @@
592 const char *
593 mpfr_get_version (void)
594 {
595 - return "3.0.0-p1";
596 + return "3.0.0-p2";
597 }
598 diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
599 --- mpfr-3.0.0-a/PATCHES 2010-07-10 00:11:19.000000000 +0000
600 +++ mpfr-3.0.0-b/PATCHES 2010-07-10 00:12:50.000000000 +0000
601 @@ -0,0 +1 @@
602 +gamma_underflow
603 diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
604 --- mpfr-3.0.0-a/VERSION 2010-06-25 13:23:13.000000000 +0000
605 +++ mpfr-3.0.0-b/VERSION 2010-07-10 00:11:53.000000000 +0000
606 @@ -1 +1 @@
607 -3.0.0-p2
608 +3.0.0-p3
609 diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
610 --- mpfr-3.0.0-a/gamma.c 2010-06-10 11:00:14.000000000 +0000
611 +++ mpfr-3.0.0-b/gamma.c 2010-07-10 00:11:46.000000000 +0000
612 @@ -274,7 +274,7 @@
613 /* we want an upper bound for x * [log(2-x)-1].
614 since x < 0, we need a lower bound on log(2-x) */
615 mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
616 - mpfr_log (xp, xp, MPFR_RNDD);
617 + mpfr_log2 (xp, xp, MPFR_RNDD);
618 mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
619 mpfr_mul (xp, xp, x, MPFR_RNDU);
621 @@ -303,8 +303,8 @@
622 {
623 mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
624 mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
625 - mpfr_log (tmp, tmp, MPFR_RNDU);
626 - mpfr_add (tmp, tmp, xp, MPFR_RNDU);
627 + mpfr_log2 (tmp, tmp, MPFR_RNDU);
628 + mpfr_add (xp, tmp, xp, MPFR_RNDU);
629 underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
630 }
632 diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
633 --- mpfr-3.0.0-a/mpfr.h 2010-06-25 13:23:13.000000000 +0000
634 +++ mpfr-3.0.0-b/mpfr.h 2010-07-10 00:11:53.000000000 +0000
635 @@ -27,7 +27,7 @@
636 #define MPFR_VERSION_MAJOR 3
637 #define MPFR_VERSION_MINOR 0
638 #define MPFR_VERSION_PATCHLEVEL 0
639 -#define MPFR_VERSION_STRING "3.0.0-p2"
640 +#define MPFR_VERSION_STRING "3.0.0-p3"
642 /* Macros dealing with MPFR VERSION */
643 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
644 diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
645 --- mpfr-3.0.0-a/tests/tgamma.c 2010-06-10 11:00:13.000000000 +0000
646 +++ mpfr-3.0.0-b/tests/tgamma.c 2010-07-10 00:11:46.000000000 +0000
647 @@ -461,6 +461,20 @@
648 mpfr_clear (x);
649 }
651 +/* bug found by Stathis, only occurs on 32-bit machines */
652 +static void
653 +test20100709 (void)
654 +{
655 + mpfr_t x;
656 + int inex;
657 +
658 + mpfr_init2 (x, 100);
659 + mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
660 + inex = mpfr_gamma (x, x, MPFR_RNDN);
661 + MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
662 + mpfr_clear (x);
663 +}
664 +
665 int
666 main (int argc, char *argv[])
667 {
668 @@ -471,6 +485,7 @@
669 test_generic (2, 100, 2);
670 gamma_integer ();
671 test20071231 ();
672 + test20100709 ();
674 data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
676 diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
677 --- mpfr-3.0.0-a/version.c 2010-06-25 13:23:13.000000000 +0000
678 +++ mpfr-3.0.0-b/version.c 2010-07-10 00:11:53.000000000 +0000
679 @@ -25,5 +25,5 @@
680 const char *
681 mpfr_get_version (void)
682 {
683 - return "3.0.0-p2";
684 + return "3.0.0-p3";
685 }
686 diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
687 --- mpfr-3.0.0-a/PATCHES 2010-09-07 08:44:01.000000000 +0000
688 +++ mpfr-3.0.0-b/PATCHES 2010-09-07 08:48:46.000000000 +0000
689 @@ -0,0 +1 @@
690 +mpfr_cmp/set_ui/si
691 diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
692 --- mpfr-3.0.0-a/VERSION 2010-07-10 00:11:53.000000000 +0000
693 +++ mpfr-3.0.0-b/VERSION 2010-09-07 08:46:06.000000000 +0000
694 @@ -1 +1 @@
695 -3.0.0-p3
696 +3.0.0-p4
697 diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
698 --- mpfr-3.0.0-a/mpfr.h 2010-07-10 00:11:53.000000000 +0000
699 +++ mpfr-3.0.0-b/mpfr.h 2010-09-07 08:46:06.000000000 +0000
700 @@ -27,7 +27,7 @@
701 #define MPFR_VERSION_MAJOR 3
702 #define MPFR_VERSION_MINOR 0
703 #define MPFR_VERSION_PATCHLEVEL 0
704 -#define MPFR_VERSION_STRING "3.0.0-p3"
705 +#define MPFR_VERSION_STRING "3.0.0-p4"
707 /* Macros dealing with MPFR VERSION */
708 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
709 @@ -798,35 +798,45 @@
710 anyway. Checking with other ICC versions is needed. Possibly detect
711 whether warnings are produced or not with a configure test.
712 + Remove C++ too, since it complains too much. */
713 +/* Added casts to improve robustness in case of undefined behavior and
714 + compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
715 + use such extensions, but these macros will be used by 3rd-party code,
716 + where such extensions may be required.
717 + Moreover casts to unsigned long have been added to avoid warnings in
718 + programs that use MPFR and are compiled with -Wconversion; such casts
719 + are OK since if X is a constant expression, then (unsigned long) X is
720 + also a constant expression, so that the optimizations still work. */
721 #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
722 #if (__GNUC__ >= 2)
723 #undef mpfr_cmp_ui
724 -/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
725 -#define mpfr_cmp_ui(_f,_u) \
726 - (__builtin_constant_p (_u) && (_u) == 0 ? \
727 - mpfr_sgn (_f) : \
728 - mpfr_cmp_ui_2exp ((_f),(_u),0))
729 +/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0.
730 + But warning! mpfr_sgn is specified as a macro in the API, thus the macro
731 + mustn't be used if side effects are possible, like here. */
732 +#define mpfr_cmp_ui(_f,_u) \
733 + (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
734 + (mpfr_sgn) (_f) : \
735 + mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
736 #undef mpfr_cmp_si
737 -#define mpfr_cmp_si(_f,_s) \
738 - (__builtin_constant_p (_s) && (_s) >= 0 ? \
739 - mpfr_cmp_ui ((_f), (_s)) : \
740 - mpfr_cmp_si_2exp ((_f), (_s), 0))
741 +#define mpfr_cmp_si(_f,_s) \
742 + (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
743 + mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) : \
744 + mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
745 #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
746 #undef mpfr_set_ui
747 -#define mpfr_set_ui(_f,_u,_r) \
748 - (__builtin_constant_p (_u) && (_u) == 0 ? \
749 - __extension__ ({ \
750 - mpfr_ptr _p = (_f); \
751 - _p->_mpfr_sign = 1; \
752 - _p->_mpfr_exp = __MPFR_EXP_ZERO; \
753 - (void) (_r); 0; }) : \
754 - mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
755 +#define mpfr_set_ui(_f,_u,_r) \
756 + (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ? \
757 + __extension__ ({ \
758 + mpfr_ptr _p = (_f); \
759 + _p->_mpfr_sign = 1; \
760 + _p->_mpfr_exp = __MPFR_EXP_ZERO; \
761 + (void) (_r); 0; }) : \
762 + mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
763 #endif
764 #undef mpfr_set_si
765 -#define mpfr_set_si(_f,_s,_r) \
766 - (__builtin_constant_p (_s) && (_s) >= 0 ? \
767 - mpfr_set_ui ((_f), (_s), (_r)) : \
768 - mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
769 +#define mpfr_set_si(_f,_s,_r) \
770 + (__builtin_constant_p (_s) && (long) (_s) >= 0 ? \
771 + mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) : \
772 + mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
773 #endif
774 #endif
776 diff -Naurd mpfr-3.0.0-a/tests/tcmp_ui.c mpfr-3.0.0-b/tests/tcmp_ui.c
777 --- mpfr-3.0.0-a/tests/tcmp_ui.c 2010-06-10 11:00:13.000000000 +0000
778 +++ mpfr-3.0.0-b/tests/tcmp_ui.c 2010-09-07 08:45:12.000000000 +0000
779 @@ -88,6 +88,126 @@
780 mpfr_clear (x);
781 }
783 +/* Since mpfr_cmp_ui and mpfr_cmp_si are also implemented by a macro
784 + with __builtin_constant_p for GCC, check that side effects are
785 + handled correctly. */
786 +static void
787 +check_macros (void)
788 +{
789 + mpfr_t x;
790 + int c;
791 +
792 + mpfr_init2 (x, 32);
793 +
794 + c = 0;
795 + mpfr_set_ui (x, 17, MPFR_RNDN);
796 + if (mpfr_cmp_ui (x, 17) != 0)
797 + {
798 + printf ("Error 1 on mpfr_cmp_ui(x,17) in check_macros\n");
799 + exit (1);
800 + }
801 + if (mpfr_cmp_ui (x, (c++, 17)) != 0)
802 + {
803 + printf ("Error 2 on mpfr_cmp_ui(x,17) in check_macros\n");
804 + exit (1);
805 + }
806 + if (c != 1)
807 + {
808 + printf ("Error 3 on mpfr_cmp_ui(x,17) in check_macros\n"
809 + "(c = %d instead of 1)\n", c);
810 + exit (1);
811 + }
812 + if (mpfr_cmp_si (x, 17) != 0)
813 + {
814 + printf ("Error 1 on mpfr_cmp_si(x,17) in check_macros\n");
815 + exit (1);
816 + }
817 + if (mpfr_cmp_si (x, (c++, 17)) != 0)
818 + {
819 + printf ("Error 2 on mpfr_cmp_si(x,17) in check_macros\n");
820 + exit (1);
821 + }
822 + if (c != 2)
823 + {
824 + printf ("Error 3 on mpfr_cmp_si(x,17) in check_macros\n"
825 + "(c = %d instead of 2)\n", c);
826 + exit (1);
827 + }
828 +
829 + c = 0;
830 + mpfr_set_ui (x, 0, MPFR_RNDN);
831 + if (mpfr_cmp_ui (x, 0) != 0)
832 + {
833 + printf ("Error 1 on mpfr_cmp_ui(x,0) in check_macros\n");
834 + exit (1);
835 + }
836 + if (mpfr_cmp_ui (x, (c++, 0)) != 0)
837 + {
838 + printf ("Error 2 on mpfr_cmp_ui(x,0) in check_macros\n");
839 + exit (1);
840 + }
841 + if (c != 1)
842 + {
843 + printf ("Error 3 on mpfr_cmp_ui(x,0) in check_macros\n"
844 + "(c = %d instead of 1)\n", c);
845 + exit (1);
846 + }
847 + if (mpfr_cmp_si (x, 0) != 0)
848 + {
849 + printf ("Error 1 on mpfr_cmp_si(x,0) in check_macros\n");
850 + exit (1);
851 + }
852 + if (mpfr_cmp_si (x, (c++, 0)) != 0)
853 + {
854 + printf ("Error 2 on mpfr_cmp_si(x,0) in check_macros\n");
855 + exit (1);
856 + }
857 + if (c != 2)
858 + {
859 + printf ("Error 3 on mpfr_cmp_si(x,0) in check_macros\n"
860 + "(c = %d instead of 2)\n", c);
861 + exit (1);
862 + }
863 +
864 + mpfr_clear (x);
865 +}
866 +
867 +/* Bug in r7114 */
868 +static void
869 +test_macros (void)
870 +{
871 + mpfr_t x[3];
872 + mpfr_ptr p;
873 +
874 + mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
875 + mpfr_set_ui (x[0], 0, MPFR_RNDN);
876 + p = x[0];
877 + if (mpfr_cmp_ui (p++, 0) != 0)
878 + {
879 + printf ("Error in mpfr_cmp_ui macro: result should be 0.\n");
880 + exit (1);
881 + }
882 + if (p != x[1])
883 + {
884 + printf ("Error in mpfr_cmp_ui macro: p - x[0] = %d (expecting 1)\n",
885 + (int) (p - x[0]));
886 + exit (1);
887 + }
888 + p = x[0];
889 + if (mpfr_cmp_si (p++, 0) != 0)
890 + {
891 + printf ("Error in mpfr_cmp_si macro: result should be 0.\n");
892 + exit (1);
893 + }
894 + if (p != x[1])
895 + {
896 + printf ("Error in mpfr_cmp_si macro: p - x[0] = %d (expecting 1)\n",
897 + (int) (p - x[0]));
898 + exit (1);
899 + }
900 + mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
901 +}
902 +
903 int
904 main (void)
905 {
906 @@ -216,6 +336,8 @@
907 mpfr_clear (x);
909 check_nan ();
910 + check_macros ();
911 + test_macros ();
913 tests_end_mpfr ();
914 return 0;
915 diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
916 --- mpfr-3.0.0-a/version.c 2010-07-10 00:11:53.000000000 +0000
917 +++ mpfr-3.0.0-b/version.c 2010-09-07 08:46:06.000000000 +0000
918 @@ -25,5 +25,5 @@
919 const char *
920 mpfr_get_version (void)
921 {
922 - return "3.0.0-p3";
923 + return "3.0.0-p4";
924 }