wok-next diff mpfr/stuff/mpfr-3.0.0-p4.patch @ rev 6945

Added libwnck, gtk+-dev and startup-notification-dev to libwnck-dev depends. Need them for pkg-config --flags libwnck-1.0 to work in clean chroot.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Oct 24 20:43:07 2010 +0000 (2010-10-24)
parents fe92c91d5083
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mpfr/stuff/mpfr-3.0.0-p4.patch	Sun Oct 24 20:43:07 2010 +0000
     1.3 @@ -0,0 +1,924 @@
     1.4 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
     1.5 +--- mpfr-3.0.0-a/PATCHES	2010-06-23 11:02:49.000000000 +0000
     1.6 ++++ mpfr-3.0.0-b/PATCHES	2010-06-23 11:03:36.000000000 +0000
     1.7 +@@ -0,0 +1 @@
     1.8 ++mpfr_out_str
     1.9 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
    1.10 +--- mpfr-3.0.0-a/VERSION	2010-06-10 11:00:14.000000000 +0000
    1.11 ++++ mpfr-3.0.0-b/VERSION	2010-06-23 11:03:20.000000000 +0000
    1.12 +@@ -1 +1 @@
    1.13 +-3.0.0
    1.14 ++3.0.0-p1
    1.15 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
    1.16 +--- mpfr-3.0.0-a/mpfr.h	2010-06-10 11:00:14.000000000 +0000
    1.17 ++++ mpfr-3.0.0-b/mpfr.h	2010-06-23 11:03:20.000000000 +0000
    1.18 +@@ -27,7 +27,7 @@
    1.19 + #define MPFR_VERSION_MAJOR 3
    1.20 + #define MPFR_VERSION_MINOR 0
    1.21 + #define MPFR_VERSION_PATCHLEVEL 0
    1.22 +-#define MPFR_VERSION_STRING "3.0.0"
    1.23 ++#define MPFR_VERSION_STRING "3.0.0-p1"
    1.24 + 
    1.25 + /* Macros dealing with MPFR VERSION */
    1.26 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
    1.27 +diff -Naurd mpfr-3.0.0-a/mpfr.texi mpfr-3.0.0-b/mpfr.texi
    1.28 +--- mpfr-3.0.0-a/mpfr.texi	2010-06-10 11:00:14.000000000 +0000
    1.29 ++++ mpfr-3.0.0-b/mpfr.texi	2010-06-23 11:03:12.000000000 +0000
    1.30 +@@ -2050,7 +2050,7 @@
    1.31 + are printed. If @var{base} is greater than 10, @samp{@@} will be used
    1.32 + instead of @samp{e} as exponent delimiter.
    1.33 + 
    1.34 +-Return the number of bytes written, or if an error occurred, return 0.
    1.35 ++Return the number of characters written, or if an error occurred, return 0.
    1.36 + @end deftypefun
    1.37 + 
    1.38 + @deftypefun size_t mpfr_inp_str (mpfr_t @var{rop}, FILE *@var{stream}, int @var{base}, mpfr_rnd_t @var{rnd})
    1.39 +diff -Naurd mpfr-3.0.0-a/out_str.c mpfr-3.0.0-b/out_str.c
    1.40 +--- mpfr-3.0.0-a/out_str.c	2010-06-10 11:00:14.000000000 +0000
    1.41 ++++ mpfr-3.0.0-b/out_str.c	2010-06-23 11:03:12.000000000 +0000
    1.42 +@@ -22,6 +22,16 @@
    1.43 + 
    1.44 + #include "mpfr-impl.h"
    1.45 + 
    1.46 ++/* Warning! S should not contain "%". */
    1.47 ++#define OUT_STR_RET(S)                          \
    1.48 ++  do                                            \
    1.49 ++    {                                           \
    1.50 ++      int r;                                    \
    1.51 ++      r = fprintf (stream, (S));                \
    1.52 ++      return r < 0 ? 0 : r;                     \
    1.53 ++    }                                           \
    1.54 ++  while (0)
    1.55 ++
    1.56 + size_t
    1.57 + mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
    1.58 +               mpfr_rnd_t rnd_mode)
    1.59 +@@ -29,6 +39,7 @@
    1.60 +   char *s, *s0;
    1.61 +   size_t l;
    1.62 +   mpfr_exp_t e;
    1.63 ++  int err;
    1.64 + 
    1.65 +   MPFR_ASSERTN (base >= 2 && base <= 62);
    1.66 + 
    1.67 +@@ -36,37 +47,16 @@
    1.68 +   if (stream == NULL)
    1.69 +     stream = stdout;
    1.70 + 
    1.71 +-  if (MPFR_IS_NAN(op))
    1.72 +-    {
    1.73 +-      fprintf (stream, "@NaN@");
    1.74 +-      return 3;
    1.75 +-    }
    1.76 +-
    1.77 +-  if (MPFR_IS_INF(op))
    1.78 +-    {
    1.79 +-      if (MPFR_SIGN(op) > 0)
    1.80 +-        {
    1.81 +-          fprintf (stream, "@Inf@");
    1.82 +-          return 3;
    1.83 +-        }
    1.84 +-      else
    1.85 +-        {
    1.86 +-          fprintf (stream, "-@Inf@");
    1.87 +-          return 4;
    1.88 +-        }
    1.89 +-    }
    1.90 +-
    1.91 +-  if (MPFR_IS_ZERO(op))
    1.92 ++  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
    1.93 +     {
    1.94 +-      if (MPFR_SIGN(op) > 0)
    1.95 +-        {
    1.96 +-          fprintf(stream, "0");
    1.97 +-          return 1;
    1.98 +-        }
    1.99 ++      if (MPFR_IS_NAN (op))
   1.100 ++        OUT_STR_RET ("@NaN@");
   1.101 ++      else if (MPFR_IS_INF (op))
   1.102 ++        OUT_STR_RET (MPFR_IS_POS (op) ? "@Inf@" : "-@Inf@");
   1.103 +       else
   1.104 +         {
   1.105 +-          fprintf(stream, "-0");
   1.106 +-          return 2;
   1.107 ++          MPFR_ASSERTD (MPFR_IS_ZERO (op));
   1.108 ++          OUT_STR_RET (MPFR_IS_POS (op) ? "0" : "-0");
   1.109 +         }
   1.110 +     }
   1.111 + 
   1.112 +@@ -77,21 +67,31 @@
   1.113 + 
   1.114 +   l = strlen (s) + 1; /* size of allocated block returned by mpfr_get_str
   1.115 +                          - may be incorrect, as only an upper bound? */
   1.116 +-  if (*s == '-')
   1.117 +-    fputc (*s++, stream);
   1.118 + 
   1.119 +-  /* outputs mantissa */
   1.120 +-  fputc (*s++, stream); e--; /* leading digit */
   1.121 +-  fputc ((unsigned char) MPFR_DECIMAL_POINT, stream);
   1.122 +-  fputs (s, stream);         /* rest of mantissa */
   1.123 ++  /* outputs possible sign and significand */
   1.124 ++  err = (*s == '-' && fputc (*s++, stream) == EOF)
   1.125 ++    || fputc (*s++, stream) == EOF  /* leading digit */
   1.126 ++    || fputc ((unsigned char) MPFR_DECIMAL_POINT, stream) == EOF
   1.127 ++    || fputs (s, stream) == EOF;     /* trailing significand */
   1.128 +   (*__gmp_free_func) (s0, l);
   1.129 ++  if (MPFR_UNLIKELY (err))
   1.130 ++    return 0;
   1.131 ++
   1.132 ++  e--;  /* due to the leading digit */
   1.133 + 
   1.134 +   /* outputs exponent */
   1.135 +   if (e)
   1.136 +     {
   1.137 ++      int r;
   1.138 ++
   1.139 +       MPFR_ASSERTN(e >= LONG_MIN);
   1.140 +       MPFR_ASSERTN(e <= LONG_MAX);
   1.141 +-      l += fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   1.142 ++
   1.143 ++      r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
   1.144 ++      if (MPFR_UNLIKELY (r < 0))
   1.145 ++        return 0;
   1.146 ++
   1.147 ++      l += r;
   1.148 +     }
   1.149 + 
   1.150 +   return l;
   1.151 +diff -Naurd mpfr-3.0.0-a/tests/tout_str.c mpfr-3.0.0-b/tests/tout_str.c
   1.152 +--- mpfr-3.0.0-a/tests/tout_str.c	2010-06-10 11:00:13.000000000 +0000
   1.153 ++++ mpfr-3.0.0-b/tests/tout_str.c	2010-06-23 11:03:12.000000000 +0000
   1.154 +@@ -46,22 +46,54 @@
   1.155 + special (void)
   1.156 + {
   1.157 +   mpfr_t x;
   1.158 ++  unsigned int n;
   1.159 + 
   1.160 +   mpfr_init (x);
   1.161 + 
   1.162 +   mpfr_set_nan (x);
   1.163 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.164 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.165 ++  if (n != 5)
   1.166 ++    {
   1.167 ++      printf ("Error: mpfr_out_str (file, 10, 0, NaN, MPFR_RNDN) wrote %u "
   1.168 ++              "characters instead of 5.\n", n);
   1.169 ++      exit (1);
   1.170 ++    }
   1.171 + 
   1.172 +   mpfr_set_inf (x, 1);
   1.173 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.174 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.175 ++  if (n != 5)
   1.176 ++    {
   1.177 ++      printf ("Error: mpfr_out_str (file, 10, 0, +Inf, MPFR_RNDN) wrote %u "
   1.178 ++               "characters instead of 5.\n", n);
   1.179 ++      exit (1);
   1.180 ++    }
   1.181 + 
   1.182 +   mpfr_set_inf (x, -1);
   1.183 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.184 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.185 ++  if (n != 6)
   1.186 ++    {
   1.187 ++      printf ("Error: mpfr_out_str (file, 10, 0, -Inf, MPFR_RNDN) wrote %u "
   1.188 ++               "characters instead of 6.\n", n);
   1.189 ++      exit (1);
   1.190 ++    }
   1.191 + 
   1.192 +   mpfr_set_ui (x, 0, MPFR_RNDN);
   1.193 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.194 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.195 ++  if (n != 1)
   1.196 ++    {
   1.197 ++      printf ("Error: mpfr_out_str (file, 10, 0, +0, MPFR_RNDN) wrote %u "
   1.198 ++               "characters instead of 1.\n", n);
   1.199 ++      exit (1);
   1.200 ++    }
   1.201 ++
   1.202 +   mpfr_neg (x, x, MPFR_RNDN);
   1.203 +-  mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.204 ++  n = mpfr_out_str (fout, 10, 0, x, MPFR_RNDN);
   1.205 ++  if (n != 2)
   1.206 ++    {
   1.207 ++      printf ("Error: mpfr_out_str (file, 10, 0, -0, MPFR_RNDN) wrote %u "
   1.208 ++               "characters instead of 2.\n", n);
   1.209 ++      exit (1);
   1.210 ++    }
   1.211 + 
   1.212 +   mpfr_clear (x);
   1.213 + }
   1.214 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   1.215 +--- mpfr-3.0.0-a/version.c	2010-06-10 11:00:14.000000000 +0000
   1.216 ++++ mpfr-3.0.0-b/version.c	2010-06-23 11:03:20.000000000 +0000
   1.217 +@@ -25,5 +25,5 @@
   1.218 + const char *
   1.219 + mpfr_get_version (void)
   1.220 + {
   1.221 +-  return "3.0.0";
   1.222 ++  return "3.0.0-p1";
   1.223 + }
   1.224 +diff -Naurd mpfr-3.0.0-a/Makefile.in mpfr-3.0.0-b/Makefile.in
   1.225 +--- mpfr-3.0.0-a/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   1.226 ++++ mpfr-3.0.0-b/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   1.227 +@@ -239,6 +239,7 @@
   1.228 + distuninstallcheck_listfiles = find . -type f -print
   1.229 + distcleancheck_listfiles = find . -type f -print
   1.230 + ACLOCAL = @ACLOCAL@
   1.231 ++ALLOCA = @ALLOCA@
   1.232 + AMTAR = @AMTAR@
   1.233 + AR = @AR@
   1.234 + AS = @AS@
   1.235 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   1.236 +--- mpfr-3.0.0-a/PATCHES	2010-06-23 11:03:36.000000000 +0000
   1.237 ++++ mpfr-3.0.0-b/PATCHES	2010-06-25 13:23:13.000000000 +0000
   1.238 +@@ -0,0 +1 @@
   1.239 ++alloca
   1.240 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   1.241 +--- mpfr-3.0.0-a/VERSION	2010-06-23 11:03:20.000000000 +0000
   1.242 ++++ mpfr-3.0.0-b/VERSION	2010-06-25 13:23:13.000000000 +0000
   1.243 +@@ -1 +1 @@
   1.244 +-3.0.0-p1
   1.245 ++3.0.0-p2
   1.246 +diff -Naurd mpfr-3.0.0-a/acinclude.m4 mpfr-3.0.0-b/acinclude.m4
   1.247 +--- mpfr-3.0.0-a/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   1.248 ++++ mpfr-3.0.0-b/acinclude.m4	2010-06-10 11:00:14.000000000 +0000
   1.249 +@@ -59,6 +59,9 @@
   1.250 + dnl sys/fpu.h - MIPS specific
   1.251 + AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
   1.252 + 
   1.253 ++dnl Check how to get `alloca'
   1.254 ++AC_FUNC_ALLOCA
   1.255 ++
   1.256 + dnl SIZE_MAX macro
   1.257 + gl_SIZE_MAX
   1.258 + 
   1.259 +diff -Naurd mpfr-3.0.0-a/configure mpfr-3.0.0-b/configure
   1.260 +--- mpfr-3.0.0-a/configure	2010-06-10 11:00:51.000000000 +0000
   1.261 ++++ mpfr-3.0.0-b/configure	2010-06-25 13:23:05.000000000 +0000
   1.262 +@@ -783,6 +783,7 @@
   1.263 + OBJDUMP
   1.264 + DLLTOOL
   1.265 + AS
   1.266 ++ALLOCA
   1.267 + MPFR_LIBM
   1.268 + ANSI2KNR
   1.269 + U
   1.270 +@@ -5622,6 +5623,197 @@
   1.271 + done
   1.272 + 
   1.273 + 
   1.274 ++# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
   1.275 ++# for constant arguments.  Useless!
   1.276 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
   1.277 ++$as_echo_n "checking for working alloca.h... " >&6; }
   1.278 ++if test "${ac_cv_working_alloca_h+set}" = set; then :
   1.279 ++  $as_echo_n "(cached) " >&6
   1.280 ++else
   1.281 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.282 ++/* end confdefs.h.  */
   1.283 ++#include <alloca.h>
   1.284 ++int
   1.285 ++main ()
   1.286 ++{
   1.287 ++char *p = (char *) alloca (2 * sizeof (int));
   1.288 ++			  if (p) return 0;
   1.289 ++  ;
   1.290 ++  return 0;
   1.291 ++}
   1.292 ++_ACEOF
   1.293 ++if ac_fn_c_try_link "$LINENO"; then :
   1.294 ++  ac_cv_working_alloca_h=yes
   1.295 ++else
   1.296 ++  ac_cv_working_alloca_h=no
   1.297 ++fi
   1.298 ++rm -f core conftest.err conftest.$ac_objext \
   1.299 ++    conftest$ac_exeext conftest.$ac_ext
   1.300 ++fi
   1.301 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
   1.302 ++$as_echo "$ac_cv_working_alloca_h" >&6; }
   1.303 ++if test $ac_cv_working_alloca_h = yes; then
   1.304 ++
   1.305 ++$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
   1.306 ++
   1.307 ++fi
   1.308 ++
   1.309 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
   1.310 ++$as_echo_n "checking for alloca... " >&6; }
   1.311 ++if test "${ac_cv_func_alloca_works+set}" = set; then :
   1.312 ++  $as_echo_n "(cached) " >&6
   1.313 ++else
   1.314 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.315 ++/* end confdefs.h.  */
   1.316 ++#ifdef __GNUC__
   1.317 ++# define alloca __builtin_alloca
   1.318 ++#else
   1.319 ++# ifdef _MSC_VER
   1.320 ++#  include <malloc.h>
   1.321 ++#  define alloca _alloca
   1.322 ++# else
   1.323 ++#  ifdef HAVE_ALLOCA_H
   1.324 ++#   include <alloca.h>
   1.325 ++#  else
   1.326 ++#   ifdef _AIX
   1.327 ++ #pragma alloca
   1.328 ++#   else
   1.329 ++#    ifndef alloca /* predefined by HP cc +Olibcalls */
   1.330 ++char *alloca ();
   1.331 ++#    endif
   1.332 ++#   endif
   1.333 ++#  endif
   1.334 ++# endif
   1.335 ++#endif
   1.336 ++
   1.337 ++int
   1.338 ++main ()
   1.339 ++{
   1.340 ++char *p = (char *) alloca (1);
   1.341 ++				    if (p) return 0;
   1.342 ++  ;
   1.343 ++  return 0;
   1.344 ++}
   1.345 ++_ACEOF
   1.346 ++if ac_fn_c_try_link "$LINENO"; then :
   1.347 ++  ac_cv_func_alloca_works=yes
   1.348 ++else
   1.349 ++  ac_cv_func_alloca_works=no
   1.350 ++fi
   1.351 ++rm -f core conftest.err conftest.$ac_objext \
   1.352 ++    conftest$ac_exeext conftest.$ac_ext
   1.353 ++fi
   1.354 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
   1.355 ++$as_echo "$ac_cv_func_alloca_works" >&6; }
   1.356 ++
   1.357 ++if test $ac_cv_func_alloca_works = yes; then
   1.358 ++
   1.359 ++$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
   1.360 ++
   1.361 ++else
   1.362 ++  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
   1.363 ++# that cause trouble.  Some versions do not even contain alloca or
   1.364 ++# contain a buggy version.  If you still want to use their alloca,
   1.365 ++# use ar to extract alloca.o from them instead of compiling alloca.c.
   1.366 ++
   1.367 ++ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
   1.368 ++
   1.369 ++$as_echo "#define C_ALLOCA 1" >>confdefs.h
   1.370 ++
   1.371 ++
   1.372 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
   1.373 ++$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
   1.374 ++if test "${ac_cv_os_cray+set}" = set; then :
   1.375 ++  $as_echo_n "(cached) " >&6
   1.376 ++else
   1.377 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.378 ++/* end confdefs.h.  */
   1.379 ++#if defined CRAY && ! defined CRAY2
   1.380 ++webecray
   1.381 ++#else
   1.382 ++wenotbecray
   1.383 ++#endif
   1.384 ++
   1.385 ++_ACEOF
   1.386 ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   1.387 ++  $EGREP "webecray" >/dev/null 2>&1; then :
   1.388 ++  ac_cv_os_cray=yes
   1.389 ++else
   1.390 ++  ac_cv_os_cray=no
   1.391 ++fi
   1.392 ++rm -f conftest*
   1.393 ++
   1.394 ++fi
   1.395 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
   1.396 ++$as_echo "$ac_cv_os_cray" >&6; }
   1.397 ++if test $ac_cv_os_cray = yes; then
   1.398 ++  for ac_func in _getb67 GETB67 getb67; do
   1.399 ++    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
   1.400 ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
   1.401 ++eval as_val=\$$as_ac_var
   1.402 ++   if test "x$as_val" = x""yes; then :
   1.403 ++
   1.404 ++cat >>confdefs.h <<_ACEOF
   1.405 ++#define CRAY_STACKSEG_END $ac_func
   1.406 ++_ACEOF
   1.407 ++
   1.408 ++    break
   1.409 ++fi
   1.410 ++
   1.411 ++  done
   1.412 ++fi
   1.413 ++
   1.414 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
   1.415 ++$as_echo_n "checking stack direction for C alloca... " >&6; }
   1.416 ++if test "${ac_cv_c_stack_direction+set}" = set; then :
   1.417 ++  $as_echo_n "(cached) " >&6
   1.418 ++else
   1.419 ++  if test "$cross_compiling" = yes; then :
   1.420 ++  ac_cv_c_stack_direction=0
   1.421 ++else
   1.422 ++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   1.423 ++/* end confdefs.h.  */
   1.424 ++$ac_includes_default
   1.425 ++int
   1.426 ++find_stack_direction ()
   1.427 ++{
   1.428 ++  static char *addr = 0;
   1.429 ++  auto char dummy;
   1.430 ++  if (addr == 0)
   1.431 ++    {
   1.432 ++      addr = &dummy;
   1.433 ++      return find_stack_direction ();
   1.434 ++    }
   1.435 ++  else
   1.436 ++    return (&dummy > addr) ? 1 : -1;
   1.437 ++}
   1.438 ++
   1.439 ++int
   1.440 ++main ()
   1.441 ++{
   1.442 ++  return find_stack_direction () < 0;
   1.443 ++}
   1.444 ++_ACEOF
   1.445 ++if ac_fn_c_try_run "$LINENO"; then :
   1.446 ++  ac_cv_c_stack_direction=1
   1.447 ++else
   1.448 ++  ac_cv_c_stack_direction=-1
   1.449 ++fi
   1.450 ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   1.451 ++  conftest.$ac_objext conftest.beam conftest.$ac_ext
   1.452 ++fi
   1.453 ++
   1.454 ++fi
   1.455 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
   1.456 ++$as_echo "$ac_cv_c_stack_direction" >&6; }
   1.457 ++cat >>confdefs.h <<_ACEOF
   1.458 ++#define STACK_DIRECTION $ac_cv_c_stack_direction
   1.459 ++_ACEOF
   1.460 ++
   1.461 ++
   1.462 ++fi
   1.463 ++
   1.464 ++
   1.465 + 
   1.466 +   for ac_header in stdint.h
   1.467 + do :
   1.468 +@@ -7564,13 +7756,13 @@
   1.469 + else
   1.470 +   lt_cv_nm_interface="BSD nm"
   1.471 +   echo "int some_variable = 0;" > conftest.$ac_ext
   1.472 +-  (eval echo "\"\$as_me:7567: $ac_compile\"" >&5)
   1.473 ++  (eval echo "\"\$as_me:7759: $ac_compile\"" >&5)
   1.474 +   (eval "$ac_compile" 2>conftest.err)
   1.475 +   cat conftest.err >&5
   1.476 +-  (eval echo "\"\$as_me:7570: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   1.477 ++  (eval echo "\"\$as_me:7762: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   1.478 +   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   1.479 +   cat conftest.err >&5
   1.480 +-  (eval echo "\"\$as_me:7573: output\"" >&5)
   1.481 ++  (eval echo "\"\$as_me:7765: output\"" >&5)
   1.482 +   cat conftest.out >&5
   1.483 +   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
   1.484 +     lt_cv_nm_interface="MS dumpbin"
   1.485 +@@ -8772,7 +8964,7 @@
   1.486 +   ;;
   1.487 + *-*-irix6*)
   1.488 +   # Find out which ABI we are using.
   1.489 +-  echo '#line 8775 "configure"' > conftest.$ac_ext
   1.490 ++  echo '#line 8967 "configure"' > conftest.$ac_ext
   1.491 +   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   1.492 +   (eval $ac_compile) 2>&5
   1.493 +   ac_status=$?
   1.494 +@@ -10032,11 +10224,11 @@
   1.495 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.496 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.497 +    -e 's:$: $lt_compiler_flag:'`
   1.498 +-   (eval echo "\"\$as_me:10035: $lt_compile\"" >&5)
   1.499 ++   (eval echo "\"\$as_me:10227: $lt_compile\"" >&5)
   1.500 +    (eval "$lt_compile" 2>conftest.err)
   1.501 +    ac_status=$?
   1.502 +    cat conftest.err >&5
   1.503 +-   echo "$as_me:10039: \$? = $ac_status" >&5
   1.504 ++   echo "$as_me:10231: \$? = $ac_status" >&5
   1.505 +    if (exit $ac_status) && test -s "$ac_outfile"; then
   1.506 +      # The compiler can only warn and ignore the option if not recognized
   1.507 +      # So say no if there are warnings other than the usual output.
   1.508 +@@ -10371,11 +10563,11 @@
   1.509 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.510 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.511 +    -e 's:$: $lt_compiler_flag:'`
   1.512 +-   (eval echo "\"\$as_me:10374: $lt_compile\"" >&5)
   1.513 ++   (eval echo "\"\$as_me:10566: $lt_compile\"" >&5)
   1.514 +    (eval "$lt_compile" 2>conftest.err)
   1.515 +    ac_status=$?
   1.516 +    cat conftest.err >&5
   1.517 +-   echo "$as_me:10378: \$? = $ac_status" >&5
   1.518 ++   echo "$as_me:10570: \$? = $ac_status" >&5
   1.519 +    if (exit $ac_status) && test -s "$ac_outfile"; then
   1.520 +      # The compiler can only warn and ignore the option if not recognized
   1.521 +      # So say no if there are warnings other than the usual output.
   1.522 +@@ -10476,11 +10668,11 @@
   1.523 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.524 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.525 +    -e 's:$: $lt_compiler_flag:'`
   1.526 +-   (eval echo "\"\$as_me:10479: $lt_compile\"" >&5)
   1.527 ++   (eval echo "\"\$as_me:10671: $lt_compile\"" >&5)
   1.528 +    (eval "$lt_compile" 2>out/conftest.err)
   1.529 +    ac_status=$?
   1.530 +    cat out/conftest.err >&5
   1.531 +-   echo "$as_me:10483: \$? = $ac_status" >&5
   1.532 ++   echo "$as_me:10675: \$? = $ac_status" >&5
   1.533 +    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   1.534 +    then
   1.535 +      # The compiler can only warn and ignore the option if not recognized
   1.536 +@@ -10531,11 +10723,11 @@
   1.537 +    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
   1.538 +    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
   1.539 +    -e 's:$: $lt_compiler_flag:'`
   1.540 +-   (eval echo "\"\$as_me:10534: $lt_compile\"" >&5)
   1.541 ++   (eval echo "\"\$as_me:10726: $lt_compile\"" >&5)
   1.542 +    (eval "$lt_compile" 2>out/conftest.err)
   1.543 +    ac_status=$?
   1.544 +    cat out/conftest.err >&5
   1.545 +-   echo "$as_me:10538: \$? = $ac_status" >&5
   1.546 ++   echo "$as_me:10730: \$? = $ac_status" >&5
   1.547 +    if (exit $ac_status) && test -s out/conftest2.$ac_objext
   1.548 +    then
   1.549 +      # The compiler can only warn and ignore the option if not recognized
   1.550 +@@ -12915,7 +13107,7 @@
   1.551 +   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   1.552 +   lt_status=$lt_dlunknown
   1.553 +   cat > conftest.$ac_ext <<_LT_EOF
   1.554 +-#line 12918 "configure"
   1.555 ++#line 13110 "configure"
   1.556 + #include "confdefs.h"
   1.557 + 
   1.558 + #if HAVE_DLFCN_H
   1.559 +@@ -13011,7 +13203,7 @@
   1.560 +   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   1.561 +   lt_status=$lt_dlunknown
   1.562 +   cat > conftest.$ac_ext <<_LT_EOF
   1.563 +-#line 13014 "configure"
   1.564 ++#line 13206 "configure"
   1.565 + #include "confdefs.h"
   1.566 + 
   1.567 + #if HAVE_DLFCN_H
   1.568 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   1.569 +--- mpfr-3.0.0-a/mpfr.h	2010-06-23 11:03:20.000000000 +0000
   1.570 ++++ mpfr-3.0.0-b/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   1.571 +@@ -27,7 +27,7 @@
   1.572 + #define MPFR_VERSION_MAJOR 3
   1.573 + #define MPFR_VERSION_MINOR 0
   1.574 + #define MPFR_VERSION_PATCHLEVEL 0
   1.575 +-#define MPFR_VERSION_STRING "3.0.0-p1"
   1.576 ++#define MPFR_VERSION_STRING "3.0.0-p2"
   1.577 + 
   1.578 + /* Macros dealing with MPFR VERSION */
   1.579 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   1.580 +diff -Naurd mpfr-3.0.0-a/tests/Makefile.in mpfr-3.0.0-b/tests/Makefile.in
   1.581 +--- mpfr-3.0.0-a/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   1.582 ++++ mpfr-3.0.0-b/tests/Makefile.in	2010-06-10 11:00:52.000000000 +0000
   1.583 +@@ -960,6 +960,7 @@
   1.584 + red=; grn=; lgn=; blu=; std=
   1.585 + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   1.586 + ACLOCAL = @ACLOCAL@
   1.587 ++ALLOCA = @ALLOCA@
   1.588 + AMTAR = @AMTAR@
   1.589 + AR = @AR@
   1.590 + AS = @AS@
   1.591 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   1.592 +--- mpfr-3.0.0-a/version.c	2010-06-23 11:03:20.000000000 +0000
   1.593 ++++ mpfr-3.0.0-b/version.c	2010-06-25 13:23:13.000000000 +0000
   1.594 +@@ -25,5 +25,5 @@
   1.595 + const char *
   1.596 + mpfr_get_version (void)
   1.597 + {
   1.598 +-  return "3.0.0-p1";
   1.599 ++  return "3.0.0-p2";
   1.600 + }
   1.601 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   1.602 +--- mpfr-3.0.0-a/PATCHES	2010-07-10 00:11:19.000000000 +0000
   1.603 ++++ mpfr-3.0.0-b/PATCHES	2010-07-10 00:12:50.000000000 +0000
   1.604 +@@ -0,0 +1 @@
   1.605 ++gamma_underflow
   1.606 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   1.607 +--- mpfr-3.0.0-a/VERSION	2010-06-25 13:23:13.000000000 +0000
   1.608 ++++ mpfr-3.0.0-b/VERSION	2010-07-10 00:11:53.000000000 +0000
   1.609 +@@ -1 +1 @@
   1.610 +-3.0.0-p2
   1.611 ++3.0.0-p3
   1.612 +diff -Naurd mpfr-3.0.0-a/gamma.c mpfr-3.0.0-b/gamma.c
   1.613 +--- mpfr-3.0.0-a/gamma.c	2010-06-10 11:00:14.000000000 +0000
   1.614 ++++ mpfr-3.0.0-b/gamma.c	2010-07-10 00:11:46.000000000 +0000
   1.615 +@@ -274,7 +274,7 @@
   1.616 +       /* we want an upper bound for x * [log(2-x)-1].
   1.617 +          since x < 0, we need a lower bound on log(2-x) */
   1.618 +       mpfr_ui_sub (xp, 2, x, MPFR_RNDD);
   1.619 +-      mpfr_log (xp, xp, MPFR_RNDD);
   1.620 ++      mpfr_log2 (xp, xp, MPFR_RNDD);
   1.621 +       mpfr_sub_ui (xp, xp, 1, MPFR_RNDD);
   1.622 +       mpfr_mul (xp, xp, x, MPFR_RNDU);
   1.623 + 
   1.624 +@@ -303,8 +303,8 @@
   1.625 +         {
   1.626 +           mpfr_sub (tmp, tmp, tmp2, MPFR_RNDZ); /* low bnd on |sin(Pi*(2-x))| */
   1.627 +           mpfr_ui_div (tmp, 12, tmp, MPFR_RNDU); /* upper bound */
   1.628 +-          mpfr_log (tmp, tmp, MPFR_RNDU);
   1.629 +-          mpfr_add (tmp, tmp, xp, MPFR_RNDU);
   1.630 ++          mpfr_log2 (tmp, tmp, MPFR_RNDU);
   1.631 ++          mpfr_add (xp, tmp, xp, MPFR_RNDU);
   1.632 +           underflow = mpfr_cmp_si (xp, expo.saved_emin - 2) <= 0;
   1.633 +         }
   1.634 + 
   1.635 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   1.636 +--- mpfr-3.0.0-a/mpfr.h	2010-06-25 13:23:13.000000000 +0000
   1.637 ++++ mpfr-3.0.0-b/mpfr.h	2010-07-10 00:11:53.000000000 +0000
   1.638 +@@ -27,7 +27,7 @@
   1.639 + #define MPFR_VERSION_MAJOR 3
   1.640 + #define MPFR_VERSION_MINOR 0
   1.641 + #define MPFR_VERSION_PATCHLEVEL 0
   1.642 +-#define MPFR_VERSION_STRING "3.0.0-p2"
   1.643 ++#define MPFR_VERSION_STRING "3.0.0-p3"
   1.644 + 
   1.645 + /* Macros dealing with MPFR VERSION */
   1.646 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   1.647 +diff -Naurd mpfr-3.0.0-a/tests/tgamma.c mpfr-3.0.0-b/tests/tgamma.c
   1.648 +--- mpfr-3.0.0-a/tests/tgamma.c	2010-06-10 11:00:13.000000000 +0000
   1.649 ++++ mpfr-3.0.0-b/tests/tgamma.c	2010-07-10 00:11:46.000000000 +0000
   1.650 +@@ -461,6 +461,20 @@
   1.651 +   mpfr_clear (x);
   1.652 + }
   1.653 + 
   1.654 ++/* bug found by Stathis, only occurs on 32-bit machines */
   1.655 ++static void
   1.656 ++test20100709 (void)
   1.657 ++{
   1.658 ++  mpfr_t x;
   1.659 ++  int inex;
   1.660 ++
   1.661 ++  mpfr_init2 (x, 100);
   1.662 ++  mpfr_set_str (x, "-4.6308260837372266e+07", 10, MPFR_RNDN);
   1.663 ++  inex = mpfr_gamma (x, x, MPFR_RNDN);
   1.664 ++  MPFR_ASSERTN(MPFR_IS_ZERO(x) && MPFR_IS_NEG(x) && inex > 0);
   1.665 ++  mpfr_clear (x);
   1.666 ++}
   1.667 ++
   1.668 + int
   1.669 + main (int argc, char *argv[])
   1.670 + {
   1.671 +@@ -471,6 +485,7 @@
   1.672 +   test_generic (2, 100, 2);
   1.673 +   gamma_integer ();
   1.674 +   test20071231 ();
   1.675 ++  test20100709 ();
   1.676 + 
   1.677 +   data_check ("data/gamma", mpfr_gamma, "mpfr_gamma");
   1.678 + 
   1.679 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   1.680 +--- mpfr-3.0.0-a/version.c	2010-06-25 13:23:13.000000000 +0000
   1.681 ++++ mpfr-3.0.0-b/version.c	2010-07-10 00:11:53.000000000 +0000
   1.682 +@@ -25,5 +25,5 @@
   1.683 + const char *
   1.684 + mpfr_get_version (void)
   1.685 + {
   1.686 +-  return "3.0.0-p2";
   1.687 ++  return "3.0.0-p3";
   1.688 + }
   1.689 +diff -Naurd mpfr-3.0.0-a/PATCHES mpfr-3.0.0-b/PATCHES
   1.690 +--- mpfr-3.0.0-a/PATCHES	2010-09-07 08:44:01.000000000 +0000
   1.691 ++++ mpfr-3.0.0-b/PATCHES	2010-09-07 08:48:46.000000000 +0000
   1.692 +@@ -0,0 +1 @@
   1.693 ++mpfr_cmp/set_ui/si
   1.694 +diff -Naurd mpfr-3.0.0-a/VERSION mpfr-3.0.0-b/VERSION
   1.695 +--- mpfr-3.0.0-a/VERSION	2010-07-10 00:11:53.000000000 +0000
   1.696 ++++ mpfr-3.0.0-b/VERSION	2010-09-07 08:46:06.000000000 +0000
   1.697 +@@ -1 +1 @@
   1.698 +-3.0.0-p3
   1.699 ++3.0.0-p4
   1.700 +diff -Naurd mpfr-3.0.0-a/mpfr.h mpfr-3.0.0-b/mpfr.h
   1.701 +--- mpfr-3.0.0-a/mpfr.h	2010-07-10 00:11:53.000000000 +0000
   1.702 ++++ mpfr-3.0.0-b/mpfr.h	2010-09-07 08:46:06.000000000 +0000
   1.703 +@@ -27,7 +27,7 @@
   1.704 + #define MPFR_VERSION_MAJOR 3
   1.705 + #define MPFR_VERSION_MINOR 0
   1.706 + #define MPFR_VERSION_PATCHLEVEL 0
   1.707 +-#define MPFR_VERSION_STRING "3.0.0-p3"
   1.708 ++#define MPFR_VERSION_STRING "3.0.0-p4"
   1.709 + 
   1.710 + /* Macros dealing with MPFR VERSION */
   1.711 + #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
   1.712 +@@ -798,35 +798,45 @@
   1.713 +      anyway. Checking with other ICC versions is needed. Possibly detect
   1.714 +      whether warnings are produced or not with a configure test.
   1.715 +    + Remove C++ too, since it complains too much. */
   1.716 ++/* Added casts to improve robustness in case of undefined behavior and
   1.717 ++   compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
   1.718 ++   use such extensions, but these macros will be used by 3rd-party code,
   1.719 ++   where such extensions may be required.
   1.720 ++   Moreover casts to unsigned long have been added to avoid warnings in
   1.721 ++   programs that use MPFR and are compiled with -Wconversion; such casts
   1.722 ++   are OK since if X is a constant expression, then (unsigned long) X is
   1.723 ++   also a constant expression, so that the optimizations still work. */
   1.724 + #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
   1.725 + #if (__GNUC__ >= 2)
   1.726 + #undef mpfr_cmp_ui
   1.727 +-/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. */
   1.728 +-#define mpfr_cmp_ui(_f,_u)                 \
   1.729 +- (__builtin_constant_p (_u) && (_u) == 0 ? \
   1.730 +-   mpfr_sgn (_f) :                         \
   1.731 +-   mpfr_cmp_ui_2exp ((_f),(_u),0))
   1.732 ++/* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0.
   1.733 ++   But warning! mpfr_sgn is specified as a macro in the API, thus the macro
   1.734 ++   mustn't be used if side effects are possible, like here. */
   1.735 ++#define mpfr_cmp_ui(_f,_u)                                      \
   1.736 ++  (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ?     \
   1.737 ++   (mpfr_sgn) (_f) :                                            \
   1.738 ++   mpfr_cmp_ui_2exp ((_f), (unsigned long) (_u), 0))
   1.739 + #undef mpfr_cmp_si
   1.740 +-#define mpfr_cmp_si(_f,_s)                 \
   1.741 +- (__builtin_constant_p (_s) && (_s) >= 0 ? \
   1.742 +-   mpfr_cmp_ui ((_f), (_s)) :              \
   1.743 +-   mpfr_cmp_si_2exp ((_f), (_s), 0))
   1.744 ++#define mpfr_cmp_si(_f,_s)                              \
   1.745 ++  (__builtin_constant_p (_s) && (long) (_s) >= 0 ?      \
   1.746 ++   mpfr_cmp_ui ((_f), (unsigned long) (long) (_s)) :    \
   1.747 ++   mpfr_cmp_si_2exp ((_f), (long) (_s), 0))
   1.748 + #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
   1.749 + #undef mpfr_set_ui
   1.750 +-#define mpfr_set_ui(_f,_u,_r)              \
   1.751 +- (__builtin_constant_p (_u) && (_u) == 0 ? \
   1.752 +-   __extension__ ({                        \
   1.753 +-     mpfr_ptr _p = (_f);                   \
   1.754 +-     _p->_mpfr_sign = 1;                   \
   1.755 +-     _p->_mpfr_exp = __MPFR_EXP_ZERO;      \
   1.756 +-     (void) (_r); 0; }) :                  \
   1.757 +-   mpfr_set_ui_2exp ((_f), (_u), 0, (_r)))
   1.758 ++#define mpfr_set_ui(_f,_u,_r)                                   \
   1.759 ++  (__builtin_constant_p (_u) && (unsigned long) (_u) == 0 ?     \
   1.760 ++   __extension__ ({                                             \
   1.761 ++       mpfr_ptr _p = (_f);                                      \
   1.762 ++       _p->_mpfr_sign = 1;                                      \
   1.763 ++       _p->_mpfr_exp = __MPFR_EXP_ZERO;                         \
   1.764 ++       (void) (_r); 0; }) :                                     \
   1.765 ++   mpfr_set_ui_2exp ((_f), (unsigned long) (_u), 0, (_r)))
   1.766 + #endif
   1.767 + #undef mpfr_set_si
   1.768 +-#define mpfr_set_si(_f,_s,_r)              \
   1.769 +- (__builtin_constant_p (_s) && (_s) >= 0 ? \
   1.770 +-   mpfr_set_ui ((_f), (_s), (_r)) :        \
   1.771 +-   mpfr_set_si_2exp ((_f), (_s), 0, (_r)))
   1.772 ++#define mpfr_set_si(_f,_s,_r)                                   \
   1.773 ++  (__builtin_constant_p (_s) && (long) (_s) >= 0 ?              \
   1.774 ++   mpfr_set_ui ((_f), (unsigned long) (long) (_s), (_r)) :      \
   1.775 ++   mpfr_set_si_2exp ((_f), (long) (_s), 0, (_r)))
   1.776 + #endif
   1.777 + #endif
   1.778 + 
   1.779 +diff -Naurd mpfr-3.0.0-a/tests/tcmp_ui.c mpfr-3.0.0-b/tests/tcmp_ui.c
   1.780 +--- mpfr-3.0.0-a/tests/tcmp_ui.c	2010-06-10 11:00:13.000000000 +0000
   1.781 ++++ mpfr-3.0.0-b/tests/tcmp_ui.c	2010-09-07 08:45:12.000000000 +0000
   1.782 +@@ -88,6 +88,126 @@
   1.783 +   mpfr_clear (x);
   1.784 + }
   1.785 + 
   1.786 ++/* Since mpfr_cmp_ui and mpfr_cmp_si are also implemented by a macro
   1.787 ++   with __builtin_constant_p for GCC, check that side effects are
   1.788 ++   handled correctly. */
   1.789 ++static void
   1.790 ++check_macros (void)
   1.791 ++{
   1.792 ++  mpfr_t x;
   1.793 ++  int c;
   1.794 ++
   1.795 ++  mpfr_init2 (x, 32);
   1.796 ++
   1.797 ++  c = 0;
   1.798 ++  mpfr_set_ui (x, 17, MPFR_RNDN);
   1.799 ++  if (mpfr_cmp_ui (x, 17) != 0)
   1.800 ++    {
   1.801 ++      printf ("Error 1 on mpfr_cmp_ui(x,17) in check_macros\n");
   1.802 ++      exit (1);
   1.803 ++    }
   1.804 ++  if (mpfr_cmp_ui (x, (c++, 17)) != 0)
   1.805 ++    {
   1.806 ++      printf ("Error 2 on mpfr_cmp_ui(x,17) in check_macros\n");
   1.807 ++      exit (1);
   1.808 ++    }
   1.809 ++  if (c != 1)
   1.810 ++    {
   1.811 ++      printf ("Error 3 on mpfr_cmp_ui(x,17) in check_macros\n"
   1.812 ++              "(c = %d instead of 1)\n", c);
   1.813 ++      exit (1);
   1.814 ++    }
   1.815 ++  if (mpfr_cmp_si (x, 17) != 0)
   1.816 ++    {
   1.817 ++      printf ("Error 1 on mpfr_cmp_si(x,17) in check_macros\n");
   1.818 ++      exit (1);
   1.819 ++    }
   1.820 ++  if (mpfr_cmp_si (x, (c++, 17)) != 0)
   1.821 ++    {
   1.822 ++      printf ("Error 2 on mpfr_cmp_si(x,17) in check_macros\n");
   1.823 ++      exit (1);
   1.824 ++    }
   1.825 ++  if (c != 2)
   1.826 ++    {
   1.827 ++      printf ("Error 3 on mpfr_cmp_si(x,17) in check_macros\n"
   1.828 ++              "(c = %d instead of 2)\n", c);
   1.829 ++      exit (1);
   1.830 ++    }
   1.831 ++
   1.832 ++  c = 0;
   1.833 ++  mpfr_set_ui (x, 0, MPFR_RNDN);
   1.834 ++  if (mpfr_cmp_ui (x, 0) != 0)
   1.835 ++    {
   1.836 ++      printf ("Error 1 on mpfr_cmp_ui(x,0) in check_macros\n");
   1.837 ++      exit (1);
   1.838 ++    }
   1.839 ++  if (mpfr_cmp_ui (x, (c++, 0)) != 0)
   1.840 ++    {
   1.841 ++      printf ("Error 2 on mpfr_cmp_ui(x,0) in check_macros\n");
   1.842 ++      exit (1);
   1.843 ++    }
   1.844 ++  if (c != 1)
   1.845 ++    {
   1.846 ++      printf ("Error 3 on mpfr_cmp_ui(x,0) in check_macros\n"
   1.847 ++              "(c = %d instead of 1)\n", c);
   1.848 ++      exit (1);
   1.849 ++    }
   1.850 ++  if (mpfr_cmp_si (x, 0) != 0)
   1.851 ++    {
   1.852 ++      printf ("Error 1 on mpfr_cmp_si(x,0) in check_macros\n");
   1.853 ++      exit (1);
   1.854 ++    }
   1.855 ++  if (mpfr_cmp_si (x, (c++, 0)) != 0)
   1.856 ++    {
   1.857 ++      printf ("Error 2 on mpfr_cmp_si(x,0) in check_macros\n");
   1.858 ++      exit (1);
   1.859 ++    }
   1.860 ++  if (c != 2)
   1.861 ++    {
   1.862 ++      printf ("Error 3 on mpfr_cmp_si(x,0) in check_macros\n"
   1.863 ++              "(c = %d instead of 2)\n", c);
   1.864 ++      exit (1);
   1.865 ++    }
   1.866 ++
   1.867 ++  mpfr_clear (x);
   1.868 ++}
   1.869 ++
   1.870 ++/* Bug in r7114 */
   1.871 ++static void
   1.872 ++test_macros (void)
   1.873 ++{
   1.874 ++  mpfr_t x[3];
   1.875 ++  mpfr_ptr p;
   1.876 ++
   1.877 ++  mpfr_inits (x[0], x[1], x[2], (mpfr_ptr) 0);
   1.878 ++  mpfr_set_ui (x[0], 0, MPFR_RNDN);
   1.879 ++  p = x[0];
   1.880 ++  if (mpfr_cmp_ui (p++, 0) != 0)
   1.881 ++    {
   1.882 ++      printf ("Error in mpfr_cmp_ui macro: result should be 0.\n");
   1.883 ++      exit (1);
   1.884 ++    }
   1.885 ++  if (p != x[1])
   1.886 ++    {
   1.887 ++      printf ("Error in mpfr_cmp_ui macro: p - x[0] = %d (expecting 1)\n",
   1.888 ++              (int) (p - x[0]));
   1.889 ++      exit (1);
   1.890 ++    }
   1.891 ++  p = x[0];
   1.892 ++  if (mpfr_cmp_si (p++, 0) != 0)
   1.893 ++    {
   1.894 ++      printf ("Error in mpfr_cmp_si macro: result should be 0.\n");
   1.895 ++      exit (1);
   1.896 ++    }
   1.897 ++  if (p != x[1])
   1.898 ++    {
   1.899 ++      printf ("Error in mpfr_cmp_si macro: p - x[0] = %d (expecting 1)\n",
   1.900 ++              (int) (p - x[0]));
   1.901 ++      exit (1);
   1.902 ++    }
   1.903 ++  mpfr_clears (x[0], x[1], x[2], (mpfr_ptr) 0);
   1.904 ++}
   1.905 ++
   1.906 + int
   1.907 + main (void)
   1.908 + {
   1.909 +@@ -216,6 +336,8 @@
   1.910 +   mpfr_clear (x);
   1.911 + 
   1.912 +   check_nan ();
   1.913 ++  check_macros ();
   1.914 ++  test_macros ();
   1.915 + 
   1.916 +   tests_end_mpfr ();
   1.917 +   return 0;
   1.918 +diff -Naurd mpfr-3.0.0-a/version.c mpfr-3.0.0-b/version.c
   1.919 +--- mpfr-3.0.0-a/version.c	2010-07-10 00:11:53.000000000 +0000
   1.920 ++++ mpfr-3.0.0-b/version.c	2010-09-07 08:46:06.000000000 +0000
   1.921 +@@ -25,5 +25,5 @@
   1.922 + const char *
   1.923 + mpfr_get_version (void)
   1.924 + {
   1.925 +-  return "3.0.0-p3";
   1.926 ++  return "3.0.0-p4";
   1.927 + }