aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/gmp/Makefile3
-rw-r--r--math/gmp/distinfo6
-rw-r--r--math/gmp/files/patch-gmpxx.h513
-rw-r--r--math/gmp/files/patch-mpn_generic_addsub_n.c50
-rw-r--r--math/gmp/files/patch-mpz_set_d.c12
-rw-r--r--math/libgmp4/Makefile3
-rw-r--r--math/libgmp4/distinfo6
-rw-r--r--math/libgmp4/files/patch-gmpxx.h513
-rw-r--r--math/libgmp4/files/patch-mpn_generic_addsub_n.c50
-rw-r--r--math/libgmp4/files/patch-mpz_set_d.c12
10 files changed, 8 insertions, 1160 deletions
diff --git a/math/gmp/Makefile b/math/gmp/Makefile
index 7a4909e3dfc6..e5cee1c823c3 100644
--- a/math/gmp/Makefile
+++ b/math/gmp/Makefile
@@ -7,8 +7,7 @@
#
PORTNAME= libgmp
-PORTVERSION= 4.2.1
-PORTREVISION= 2
+PORTVERSION= 4.2.2
CATEGORIES= math devel
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= gmp
diff --git a/math/gmp/distinfo b/math/gmp/distinfo
index 549bd20791d5..dcb12714f169 100644
--- a/math/gmp/distinfo
+++ b/math/gmp/distinfo
@@ -1,3 +1,3 @@
-MD5 (gmp-4.2.1.tar.gz) = 5603ae75bc0cb1b21ad0187308a23c84
-SHA256 (gmp-4.2.1.tar.gz) = 44878583298e7405b90de21998b8eed2b0ca7281ac8abab6ee4f9e118bb530be
-SIZE (gmp-4.2.1.tar.gz) = 2249464
+MD5 (gmp-4.2.2.tar.gz) = 1def49df60248a08374ecd6cdcaa5d3d
+SHA256 (gmp-4.2.2.tar.gz) = db1663aefaa37e6fe69898729ece2a86568792b9009cc1ae4b6b189e0f0fce6a
+SIZE (gmp-4.2.2.tar.gz) = 2279978
diff --git a/math/gmp/files/patch-gmpxx.h b/math/gmp/files/patch-gmpxx.h
deleted file mode 100644
index 039e4f45e1e6..000000000000
--- a/math/gmp/files/patch-gmpxx.h
+++ /dev/null
@@ -1,513 +0,0 @@
---- gmpxx.h.orig Sat Apr 8 21:15:38 2006
-+++ gmpxx.h Wed Feb 7 07:56:24 2007
-@@ -1277,92 +1277,6 @@
- { return -mpf_cmp_d(f, d); }
- };
-
--struct __gmp_ternary_addmul // z = w + v * u
--{
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u)
-- { mpz_set(z, w); mpz_addmul(z, v, u); }
--
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l)
-- { mpz_set(z, w); mpz_addmul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v)
-- { mpz_set(z, w); mpz_addmul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_addmul_ui(z, v, l);
-- else
-- mpz_submul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_addmul_ui(z, v, l);
-- else
-- mpz_submul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_addmul(z, v, temp);
-- mpz_clear(temp);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_addmul(z, temp, v);
-- mpz_clear(temp);
-- }
--};
--
--struct __gmp_ternary_submul // z = w - v * u
--{
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u)
-- { mpz_set(z, w); mpz_submul(z, v, u); }
--
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l)
-- { mpz_set(z, w); mpz_submul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v)
-- { mpz_set(z, w); mpz_submul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_submul_ui(z, v, l);
-- else
-- mpz_addmul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_submul_ui(z, v, l);
-- else
-- mpz_addmul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_submul(z, v, temp);
-- mpz_clear(temp);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_submul(z, temp, v);
-- mpz_clear(temp);
-- }
--};
--
- struct __gmp_rand_function
- {
- static void eval(mpz_ptr z, gmp_randstate_t s, unsigned long int l)
-@@ -2862,417 +2776,6 @@
- __GMPZQ_DEFINE_EXPR(__gmp_binary_minus)
-
-
--/* Integer ternary expressions of the kind `a+b*c' or `a*b+c' can be
-- evaluated directly via mpz_addmul */
--
--// a + b * c
--#define __GMP_DEFINE_TERNARY_EXPR(eval_fun1, eval_fun2, eval_both) \
-- \
--template <> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), \
-- expr.val2.get_val2().get_mpz_t()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- temp.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val1()); \
-- eval_both::eval(z, expr.val1.get_mpz_t(), temp.get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, U, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, U, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val1()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), temp.get_mpz_t(), expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<T, __gmp_expr<mpz_t, U>, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <T, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), temp.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val2.get_val1()); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), temp1.get_mpz_t(), temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, U>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <mpz_class, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, mpz_class, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- eval_both::eval(z, temp1.get_mpz_t(), temp2.get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, V, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, V, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<U, __gmp_expr<mpz_t, V>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <U, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), expr.val2.get_val1(), temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, \
-- __gmp_expr<mpz_t, V>, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- mpz_class temp3(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), temp3.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--};
--
--
--__GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_plus,
-- __gmp_ternary_addmul)
--__GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_minus,
-- __gmp_ternary_submul)
-
- /**************** Macros for defining functions ****************/
- /* Results of operators and functions are instances of __gmp_expr<T, U>.
diff --git a/math/gmp/files/patch-mpn_generic_addsub_n.c b/math/gmp/files/patch-mpn_generic_addsub_n.c
deleted file mode 100644
index 5e2091963d59..000000000000
--- a/math/gmp/files/patch-mpn_generic_addsub_n.c
+++ /dev/null
@@ -1,50 +0,0 @@
---- mpn/generic/addsub_n.c.orig Fri May 12 09:31:03 2006
-+++ mpn/generic/addsub_n.c Fri May 12 09:32:06 2006
-@@ -58,13 +58,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
- acyo = acyn + mpn_add_1 (r1p + off, r1p + off, this_n, acyo);
- #endif
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
-@@ -81,13 +81,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
- scyo = scyn + mpn_sub_1 (r2p + off, r2p + off, this_n, scyo);
- #endif
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
-@@ -105,13 +105,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (tp, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (tp, s1p + off, s2p + off, this_n);
- acyo = acyn + mpn_add_1 (tp, tp, this_n, acyo);
- #endif
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
diff --git a/math/gmp/files/patch-mpz_set_d.c b/math/gmp/files/patch-mpz_set_d.c
deleted file mode 100644
index ec5c1a90b07a..000000000000
--- a/math/gmp/files/patch-mpz_set_d.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- mpz/set_d.c.orig Tue Mar 14 16:57:54 2006
-+++ mpz/set_d.c Wed Feb 7 07:56:31 2007
-@@ -56,6 +56,9 @@
- if (ALLOC(r) < rn)
- _mpz_realloc (r, rn);
-
-+ if (rn <= 0)
-+ rn = 0;
-+
- rp = PTR (r);
-
- switch (rn)
diff --git a/math/libgmp4/Makefile b/math/libgmp4/Makefile
index 7a4909e3dfc6..e5cee1c823c3 100644
--- a/math/libgmp4/Makefile
+++ b/math/libgmp4/Makefile
@@ -7,8 +7,7 @@
#
PORTNAME= libgmp
-PORTVERSION= 4.2.1
-PORTREVISION= 2
+PORTVERSION= 4.2.2
CATEGORIES= math devel
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= gmp
diff --git a/math/libgmp4/distinfo b/math/libgmp4/distinfo
index 549bd20791d5..dcb12714f169 100644
--- a/math/libgmp4/distinfo
+++ b/math/libgmp4/distinfo
@@ -1,3 +1,3 @@
-MD5 (gmp-4.2.1.tar.gz) = 5603ae75bc0cb1b21ad0187308a23c84
-SHA256 (gmp-4.2.1.tar.gz) = 44878583298e7405b90de21998b8eed2b0ca7281ac8abab6ee4f9e118bb530be
-SIZE (gmp-4.2.1.tar.gz) = 2249464
+MD5 (gmp-4.2.2.tar.gz) = 1def49df60248a08374ecd6cdcaa5d3d
+SHA256 (gmp-4.2.2.tar.gz) = db1663aefaa37e6fe69898729ece2a86568792b9009cc1ae4b6b189e0f0fce6a
+SIZE (gmp-4.2.2.tar.gz) = 2279978
diff --git a/math/libgmp4/files/patch-gmpxx.h b/math/libgmp4/files/patch-gmpxx.h
deleted file mode 100644
index 039e4f45e1e6..000000000000
--- a/math/libgmp4/files/patch-gmpxx.h
+++ /dev/null
@@ -1,513 +0,0 @@
---- gmpxx.h.orig Sat Apr 8 21:15:38 2006
-+++ gmpxx.h Wed Feb 7 07:56:24 2007
-@@ -1277,92 +1277,6 @@
- { return -mpf_cmp_d(f, d); }
- };
-
--struct __gmp_ternary_addmul // z = w + v * u
--{
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u)
-- { mpz_set(z, w); mpz_addmul(z, v, u); }
--
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l)
-- { mpz_set(z, w); mpz_addmul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v)
-- { mpz_set(z, w); mpz_addmul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_addmul_ui(z, v, l);
-- else
-- mpz_submul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_addmul_ui(z, v, l);
-- else
-- mpz_submul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_addmul(z, v, temp);
-- mpz_clear(temp);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_addmul(z, temp, v);
-- mpz_clear(temp);
-- }
--};
--
--struct __gmp_ternary_submul // z = w - v * u
--{
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u)
-- { mpz_set(z, w); mpz_submul(z, v, u); }
--
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l)
-- { mpz_set(z, w); mpz_submul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v)
-- { mpz_set(z, w); mpz_submul_ui(z, v, l); }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_submul_ui(z, v, l);
-- else
-- mpz_addmul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v)
-- {
-- mpz_set(z, w);
-- if (l >= 0)
-- mpz_submul_ui(z, v, l);
-- else
-- mpz_addmul_ui(z, v, -l);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_submul(z, v, temp);
-- mpz_clear(temp);
-- }
-- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v)
-- {
-- mpz_t temp;
-- mpz_init_set_d(temp, d);
-- mpz_set(z, w);
-- mpz_submul(z, temp, v);
-- mpz_clear(temp);
-- }
--};
--
- struct __gmp_rand_function
- {
- static void eval(mpz_ptr z, gmp_randstate_t s, unsigned long int l)
-@@ -2862,417 +2776,6 @@
- __GMPZQ_DEFINE_EXPR(__gmp_binary_minus)
-
-
--/* Integer ternary expressions of the kind `a+b*c' or `a*b+c' can be
-- evaluated directly via mpz_addmul */
--
--// a + b * c
--#define __GMP_DEFINE_TERNARY_EXPR(eval_fun1, eval_fun2, eval_both) \
-- \
--template <> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), \
-- expr.val2.get_val2().get_mpz_t()); } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- temp.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val1()); \
-- eval_both::eval(z, expr.val1.get_mpz_t(), temp.get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, U, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, U, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val1()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), temp.get_mpz_t(), expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<T, __gmp_expr<mpz_t, U>, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <T, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), temp.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \
--<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef mpz_class val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val2.get_val1()); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, expr.val1.get_mpz_t(), temp1.get_mpz_t(), temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> >, \
-- eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr \
-- <mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp(expr.val1); \
-- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, U>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <mpz_class, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \
-- temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, mpz_class, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, mpz_class, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- eval_both::eval(z, temp1.get_mpz_t(), temp2.get_mpz_t(), \
-- expr.val2.get_val2().get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, V, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, V, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), expr.val2.get_val2()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<U, __gmp_expr<mpz_t, V>, \
-- eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <U, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), expr.val2.get_val1(), temp2.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--}; \
-- \
--template <class T, class U, class V> \
--class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \
-- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, \
-- __gmp_expr<mpz_t, V>, eval_fun1> >, eval_fun2> > \
--{ \
--private: \
-- typedef __gmp_expr<mpz_t, T> val1_type; \
-- typedef __gmp_expr<mpz_t, __gmp_binary_expr \
-- <__gmp_expr<mpz_t, U>, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \
-- \
-- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \
--public: \
-- __gmp_expr(const val1_type &val1, const val2_type &val2) \
-- : expr(val1, val2) { } \
-- void eval(mpz_ptr z) const \
-- { \
-- mpz_class temp1(expr.val1); \
-- mpz_class temp2(expr.val2.get_val1()); \
-- mpz_class temp3(expr.val2.get_val2()); \
-- eval_both::eval \
-- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), temp3.get_mpz_t()); \
-- } \
-- const val1_type & get_val1() const { return expr.val1; } \
-- const val2_type & get_val2() const { return expr.val2; } \
-- unsigned long int get_prec() const { return mpf_get_default_prec(); } \
--};
--
--
--__GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_plus,
-- __gmp_ternary_addmul)
--__GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_minus,
-- __gmp_ternary_submul)
-
- /**************** Macros for defining functions ****************/
- /* Results of operators and functions are instances of __gmp_expr<T, U>.
diff --git a/math/libgmp4/files/patch-mpn_generic_addsub_n.c b/math/libgmp4/files/patch-mpn_generic_addsub_n.c
deleted file mode 100644
index 5e2091963d59..000000000000
--- a/math/libgmp4/files/patch-mpn_generic_addsub_n.c
+++ /dev/null
@@ -1,50 +0,0 @@
---- mpn/generic/addsub_n.c.orig Fri May 12 09:31:03 2006
-+++ mpn/generic/addsub_n.c Fri May 12 09:32:06 2006
-@@ -58,13 +58,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
- acyo = acyn + mpn_add_1 (r1p + off, r1p + off, this_n, acyo);
- #endif
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
-@@ -81,13 +81,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
- scyo = scyn + mpn_sub_1 (r2p + off, r2p + off, this_n, scyo);
- #endif
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
-@@ -105,13 +105,13 @@
- for (off = 0; off < n; off += PART_SIZE)
- {
- this_n = MIN (n - off, PART_SIZE);
--#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
-+#if HAVE_NATIVE_mpn_add_nc
- acyo = mpn_add_nc (tp, s1p + off, s2p + off, this_n, acyo);
- #else
- acyn = mpn_add_n (tp, s1p + off, s2p + off, this_n);
- acyo = acyn + mpn_add_1 (tp, tp, this_n, acyo);
- #endif
--#if HAVE_NATIVE_mpn_sub_nc || !HAVE_NATIVE_mpn_sub_n
-+#if HAVE_NATIVE_mpn_sub_nc
- scyo = mpn_sub_nc (r2p + off, s1p + off, s2p + off, this_n, scyo);
- #else
- scyn = mpn_sub_n (r2p + off, s1p + off, s2p + off, this_n);
diff --git a/math/libgmp4/files/patch-mpz_set_d.c b/math/libgmp4/files/patch-mpz_set_d.c
deleted file mode 100644
index ec5c1a90b07a..000000000000
--- a/math/libgmp4/files/patch-mpz_set_d.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- mpz/set_d.c.orig Tue Mar 14 16:57:54 2006
-+++ mpz/set_d.c Wed Feb 7 07:56:31 2007
-@@ -56,6 +56,9 @@
- if (ALLOC(r) < rn)
- _mpz_realloc (r, rn);
-
-+ if (rn <= 0)
-+ rn = 0;
-+
- rp = PTR (r);
-
- switch (rn)