[PATCH 13/20] Convert the mpz subdirectory to __GMP_*_DEFINE and include changes
Richard Henderson
rth at twiddle.net
Mon Mar 4 19:41:43 CET 2013
---
mpz/2fac_ui.c | 2 +-
mpz/abs.c | 3 +--
mpz/and.c | 2 +-
mpz/aors.h | 2 +-
mpz/aors_ui.h | 2 +-
mpz/aorsmul.c | 3 ++-
mpz/aorsmul_i.c | 3 ++-
mpz/array_init.c | 2 +-
mpz/bin_ui.c | 3 +--
mpz/bin_uiui.c | 3 +--
mpz/cdiv_q.c | 2 +-
mpz/cdiv_q_ui.c | 2 +-
mpz/cdiv_qr.c | 2 +-
mpz/cdiv_qr_ui.c | 2 +-
mpz/cdiv_r.c | 2 +-
mpz/cdiv_r_ui.c | 2 +-
mpz/cdiv_ui.c | 2 +-
mpz/cfdiv_q_2exp.c | 3 ++-
mpz/cfdiv_r_2exp.c | 3 ++-
mpz/clear.c | 2 +-
mpz/clears.c | 11 +----------
mpz/clrbit.c | 2 +-
mpz/cmp.c | 2 +-
mpz/cmp_d.c | 8 +-------
mpz/cmp_si.c | 2 +-
mpz/cmp_ui.c | 2 +-
mpz/cmpabs.c | 2 +-
mpz/cmpabs_d.c | 8 +-------
mpz/cmpabs_ui.c | 2 +-
mpz/com.c | 2 +-
mpz/combit.c | 2 +-
mpz/cong.c | 3 +--
mpz/cong_2exp.c | 2 +-
mpz/cong_ui.c | 3 +--
mpz/dive_ui.c | 2 +-
mpz/divegcd.c | 3 +--
mpz/divexact.c | 4 +---
mpz/divis.c | 2 +-
mpz/divis_2exp.c | 2 +-
mpz/divis_ui.c | 3 +--
mpz/dump.c | 4 +---
mpz/export.c | 4 +---
mpz/fac_ui.c | 2 +-
mpz/fdiv_q.c | 2 +-
mpz/fdiv_q_ui.c | 2 +-
mpz/fdiv_qr.c | 2 +-
mpz/fdiv_qr_ui.c | 2 +-
mpz/fdiv_r.c | 2 +-
mpz/fdiv_r_ui.c | 2 +-
mpz/fdiv_ui.c | 2 +-
mpz/fib2_ui.c | 3 +--
mpz/fib_ui.c | 4 +---
mpz/fits_s.h | 2 +-
mpz/fits_uint.c | 4 ++--
mpz/fits_ulong.c | 4 ++--
mpz/fits_ushort.c | 4 ++--
mpz/gcd.c | 3 +--
mpz/gcd_ui.c | 3 +--
mpz/gcdext.c | 3 +--
mpz/get_d.c | 2 +-
mpz/get_d_2exp.c | 3 +--
mpz/get_si.c | 2 +-
mpz/get_str.c | 4 +---
mpz/get_ui.c | 4 ++--
mpz/getlimbn.c | 4 ++--
mpz/hamdist.c | 2 +-
mpz/import.c | 3 +--
mpz/init.c | 2 +-
mpz/init2.c | 4 +---
mpz/inits.c | 11 +----------
mpz/inp_raw.c | 3 +--
mpz/inp_str.c | 5 +----
mpz/invert.c | 2 +-
mpz/ior.c | 2 +-
mpz/iset.c | 2 +-
mpz/iset_d.c | 2 +-
mpz/iset_si.c | 2 +-
mpz/iset_str.c | 2 +-
mpz/iset_ui.c | 2 +-
mpz/jacobi.c | 4 +---
mpz/kronsz.c | 3 +--
mpz/kronuz.c | 3 +--
mpz/kronzs.c | 3 +--
mpz/kronzu.c | 3 +--
mpz/lcm.c | 2 +-
mpz/lcm_ui.c | 3 +--
mpz/limbs_finish.c | 2 +-
mpz/limbs_modify.c | 2 +-
mpz/limbs_read.c | 2 +-
mpz/limbs_write.c | 2 +-
mpz/lucnum2_ui.c | 3 +--
mpz/lucnum_ui.c | 3 +--
mpz/mfac_uiui.c | 2 +-
mpz/millerrabin.c | 2 +-
mpz/mod.c | 2 +-
mpz/mul.c | 3 +--
mpz/mul_2exp.c | 2 +-
mpz/mul_i.h | 2 +-
mpz/n_pow_ui.c | 3 +--
mpz/neg.c | 3 +--
mpz/nextprime.c | 3 +--
mpz/oddfac_1.c | 3 +--
mpz/out_raw.c | 4 +---
mpz/out_str.c | 4 +---
mpz/perfpow.c | 2 +-
mpz/perfsqr.c | 4 ++--
mpz/popcount.c | 4 ++--
mpz/pow_ui.c | 2 +-
mpz/powm.c | 3 +--
mpz/powm_sec.c | 2 +-
mpz/powm_ui.c | 3 +--
mpz/pprime_p.c | 3 +--
mpz/primorial_ui.c | 2 +-
mpz/prodlimbs.c | 2 +-
mpz/random.c | 2 +-
mpz/random2.c | 2 +-
mpz/realloc.c | 4 +---
mpz/realloc2.c | 4 +---
mpz/remove.c | 2 +-
mpz/roinit_n.c | 2 +-
mpz/root.c | 3 +--
mpz/rootrem.c | 3 +--
mpz/rrandomb.c | 2 +-
mpz/scan0.c | 3 +--
mpz/scan1.c | 3 +--
mpz/set.c | 2 +-
mpz/set_d.c | 8 +-------
mpz/set_f.c | 2 +-
mpz/set_q.c | 4 ++--
mpz/set_si.c | 2 +-
mpz/set_str.c | 5 +----
mpz/set_ui.c | 2 +-
mpz/setbit.c | 2 +-
mpz/size.c | 4 ++--
mpz/sizeinbase.c | 3 +--
mpz/sqrt.c | 3 +--
mpz/sqrtrem.c | 2 +-
mpz/swap.c | 2 +-
mpz/tdiv_q.c | 3 +--
mpz/tdiv_q_2exp.c | 2 +-
mpz/tdiv_q_ui.c | 2 +-
mpz/tdiv_qr.c | 3 +--
mpz/tdiv_qr_ui.c | 2 +-
mpz/tdiv_r.c | 3 +--
mpz/tdiv_r_2exp.c | 2 +-
mpz/tdiv_r_ui.c | 2 +-
mpz/tdiv_ui.c | 3 +--
mpz/tstbit.c | 2 +-
mpz/ui_pow_ui.c | 2 +-
mpz/ui_sub.c | 2 +-
mpz/urandomb.c | 2 +-
mpz/urandomm.c | 3 +--
mpz/xor.c | 2 +-
153 files changed, 166 insertions(+), 266 deletions(-)
diff --git a/mpz/2fac_ui.c b/mpz/2fac_ui.c
index 2fd7c7f..eacd8f9 100644
--- a/mpz/2fac_ui.c
+++ b/mpz/2fac_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
@@ -83,6 +82,7 @@ mpz_2fac_ui (mpz_ptr x, unsigned long n)
}
}
}
+__GMP_PUBLIC_DEFINE (mpz_2fac_ui)
#undef FACTORS_PER_LIMB
#undef FACTOR_LIST_STORE
diff --git a/mpz/abs.c b/mpz/abs.c
index fcbb4a2..cd83b83 100644
--- a/mpz/abs.c
+++ b/mpz/abs.c
@@ -18,8 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_abs 1
-
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -42,3 +40,4 @@ mpz_abs (mpz_ptr w, mpz_srcptr u)
SIZ (w) = size;
}
+__GMP_PUBLIC_DEFINE (mpz_abs)
diff --git a/mpz/and.c b/mpz/and.c
index 5d50c76..3c844e2 100644
--- a/mpz/and.c
+++ b/mpz/and.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -231,3 +230,4 @@ mpz_and (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
}
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_and)
diff --git a/mpz/aors.h b/mpz/aors.h
index 79ac5fc..01c1a8c 100644
--- a/mpz/aors.h
+++ b/mpz/aors.h
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -111,3 +110,4 @@ FUNCTION (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
SIZ(w) = wsize;
}
+__GMP_PUBLIC_DEFINE (FUNCTION)
diff --git a/mpz/aors_ui.h b/mpz/aors_ui.h
index 6437cf3..8ea5696 100644
--- a/mpz/aors_ui.h
+++ b/mpz/aors_ui.h
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -108,3 +107,4 @@ FUNCTION (mpz_ptr w, mpz_srcptr u, unsigned long int vval)
SIZ (w) = wsize;
}
+__GMP_PUBLIC_DEFINE (FUNCTION)
diff --git a/mpz/aorsmul.c b/mpz/aorsmul.c
index d814505..d7817f8 100644
--- a/mpz/aorsmul.c
+++ b/mpz/aorsmul.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -145,9 +144,11 @@ mpz_addmul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
{
mpz_aorsmul (w, u, v, (mp_size_t) 0);
}
+__GMP_PUBLIC_DEFINE (mpz_addmul)
void
mpz_submul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
{
mpz_aorsmul (w, u, v, (mp_size_t) -1);
}
+__GMP_PUBLIC_DEFINE (mpz_submul)
diff --git a/mpz/aorsmul_i.c b/mpz/aorsmul_i.c
index 647b879..2b7f7b6 100644
--- a/mpz/aorsmul_i.c
+++ b/mpz/aorsmul_i.c
@@ -21,7 +21,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -214,6 +213,7 @@ mpz_addmul_ui (mpz_ptr w, mpz_srcptr x, unsigned long y)
#endif
mpz_aorsmul_1 (w, x, (mp_limb_t) y, (mp_size_t) 0);
}
+__GMP_PUBLIC_DEFINE (mpz_addmul_ui)
void
mpz_submul_ui (mpz_ptr w, mpz_srcptr x, unsigned long y)
@@ -242,3 +242,4 @@ mpz_submul_ui (mpz_ptr w, mpz_srcptr x, unsigned long y)
#endif
mpz_aorsmul_1 (w, x, (mp_limb_t) y & GMP_NUMB_MASK, (mp_size_t) -1);
}
+__GMP_PUBLIC_DEFINE (mpz_submul_ui)
diff --git a/mpz/array_init.c b/mpz/array_init.c
index cdec4fd..65a0b49 100644
--- a/mpz/array_init.c
+++ b/mpz/array_init.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -38,3 +37,4 @@ mpz_array_init (mpz_ptr arr, mp_size_t arr_size, mp_size_t nbits)
PTR (&arr[i]) = p + i * nlimbs;
}
}
+__GMP_PUBLIC_DEFINE (mpz_array_init)
diff --git a/mpz/bin_ui.c b/mpz/bin_ui.c
index f1de0cd..c2ad401 100644
--- a/mpz/bin_ui.c
+++ b/mpz/bin_ui.c
@@ -18,9 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* This is a poor implementation. Look at bin_uiui.c for improvement ideas.
@@ -131,3 +129,4 @@ mpz_bin_ui (mpz_ptr r, mpz_srcptr n, unsigned long int k)
mpz_clear (nacc);
mpz_clear (ni);
}
+__GMP_PUBLIC_DEFINE (mpz_bin_ui)
diff --git a/mpz/bin_uiui.c b/mpz/bin_uiui.c
index d86fb29..77e27a2 100644
--- a/mpz/bin_uiui.c
+++ b/mpz/bin_uiui.c
@@ -19,9 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
#ifndef BIN_GOETGHELUCK_THRESHOLD
#define BIN_GOETGHELUCK_THRESHOLD 1000
@@ -683,3 +681,4 @@ mpz_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
mpz_bdiv_bin_uiui (r, n, k);
}
}
+__GMP_PUBLIC_DEFINE (mpz_bin_uiui)
diff --git a/mpz/cdiv_q.c b/mpz/cdiv_q.c
index 4f00227..a336188 100644
--- a/mpz/cdiv_q.c
+++ b/mpz/cdiv_q.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -41,3 +40,4 @@ mpz_cdiv_q (mpz_ptr quot, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_q)
diff --git a/mpz/cdiv_q_ui.c b/mpz/cdiv_q_ui.c
index c4c6ad4..97bcde8 100644
--- a/mpz/cdiv_q_ui.c
+++ b/mpz/cdiv_q_ui.c
@@ -21,7 +21,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -90,3 +89,4 @@ mpz_cdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_q_ui)
diff --git a/mpz/cdiv_qr.c b/mpz/cdiv_qr.c
index e231927..abb3d74 100644
--- a/mpz/cdiv_qr.c
+++ b/mpz/cdiv_qr.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -53,3 +52,4 @@ mpz_cdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_qr)
diff --git a/mpz/cdiv_qr_ui.c b/mpz/cdiv_qr_ui.c
index eeec6ed..c8e37e5 100644
--- a/mpz/cdiv_qr_ui.c
+++ b/mpz/cdiv_qr_ui.c
@@ -21,7 +21,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -106,3 +105,4 @@ mpz_cdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long in
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_qr_ui)
diff --git a/mpz/cdiv_r.c b/mpz/cdiv_r.c
index 67e1ee1..6769a7a 100644
--- a/mpz/cdiv_r.c
+++ b/mpz/cdiv_r.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -48,3 +47,4 @@ mpz_cdiv_r (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_r)
diff --git a/mpz/cdiv_r_ui.c b/mpz/cdiv_r_ui.c
index 46e7250..39ce3e2 100644
--- a/mpz/cdiv_r_ui.c
+++ b/mpz/cdiv_r_ui.c
@@ -21,7 +21,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -97,3 +96,4 @@ mpz_cdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_r_ui)
diff --git a/mpz/cdiv_ui.c b/mpz/cdiv_ui.c
index bfbb25b..799c6e3 100644
--- a/mpz/cdiv_ui.c
+++ b/mpz/cdiv_ui.c
@@ -21,7 +21,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -90,3 +89,4 @@ mpz_cdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_ui)
diff --git a/mpz/cfdiv_q_2exp.c b/mpz/cfdiv_q_2exp.c
index c71d414..42b9a3d 100644
--- a/mpz/cfdiv_q_2exp.c
+++ b/mpz/cfdiv_q_2exp.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -94,9 +93,11 @@ mpz_cdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
cfdiv_q_2exp (w, u, cnt, 1);
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_q_2exp)
void
mpz_fdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
cfdiv_q_2exp (w, u, cnt, -1);
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_q_2exp)
diff --git a/mpz/cfdiv_r_2exp.c b/mpz/cfdiv_r_2exp.c
index 205a7bd..2cd3667 100644
--- a/mpz/cfdiv_r_2exp.c
+++ b/mpz/cfdiv_r_2exp.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -145,9 +144,11 @@ mpz_cdiv_r_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
cfdiv_r_2exp (w, u, cnt, 1);
}
+__GMP_PUBLIC_DEFINE (mpz_cdiv_r_2exp)
void
mpz_fdiv_r_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
cfdiv_r_2exp (w, u, cnt, -1);
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_r_2exp)
diff --git a/mpz/clear.c b/mpz/clear.c
index 7dfc8f4..75f16eb 100644
--- a/mpz/clear.c
+++ b/mpz/clear.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -27,3 +26,4 @@ mpz_clear (mpz_ptr m)
{
(*__gmp_free_func) (PTR (m), ALLOC (m) * BYTES_PER_MP_LIMB);
}
+__GMP_PUBLIC_DEFINE (mpz_clear)
diff --git a/mpz/clears.c b/mpz/clears.c
index e9f2cf4..470eef2 100644
--- a/mpz/clears.c
+++ b/mpz/clears.c
@@ -17,16 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "config.h"
-
-#if HAVE_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -54,3 +44,4 @@ mpz_clears (va_alist)
}
va_end (ap);
}
+__GMP_PUBLIC_DEFINE (mpz_clears)
diff --git a/mpz/clrbit.c b/mpz/clrbit.c
index 87dd210..1b193b5 100644
--- a/mpz/clrbit.c
+++ b/mpz/clrbit.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -104,3 +103,4 @@ mpz_clrbit (mpz_ptr d, mp_bitcnt_t bit_idx)
}
}
}
+__GMP_PUBLIC_DEFINE (mpz_clrbit)
diff --git a/mpz/cmp.c b/mpz/cmp.c
index b7bf0d9..baa2490 100644
--- a/mpz/cmp.c
+++ b/mpz/cmp.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -41,3 +40,4 @@ mpz_cmp (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
MPN_CMP (cmp, up, vp, asize);
return (usize >= 0 ? cmp : -cmp);
}
+__GMP_PUBLIC_DEFINE (mpz_cmp)
diff --git a/mpz/cmp_d.c b/mpz/cmp_d.c
index a9a3a96..9334433 100644
--- a/mpz/cmp_d.c
+++ b/mpz/cmp_d.c
@@ -17,13 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "config.h"
-
-#if HAVE_FLOAT_H
-#include <float.h> /* for DBL_MAX */
-#endif
-
-#include "gmp.h"
#include "gmp-impl.h"
@@ -132,3 +125,4 @@ mpz_cmp_d (mpz_srcptr z, double d)
}
#endif
}
+__GMP_PUBLIC_DEFINE (mpz_cmp_d)
diff --git a/mpz/cmp_si.c b/mpz/cmp_si.c
index fd847ee..2f945c3 100644
--- a/mpz/cmp_si.c
+++ b/mpz/cmp_si.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -58,3 +57,4 @@ _mpz_cmp_si (mpz_srcptr u, signed long int v_digit) __GMP_NOTHROW
}
#endif
}
+__GMP_PUBLIC_DEFINE (_mpz_cmp_si)
diff --git a/mpz/cmp_ui.c b/mpz/cmp_ui.c
index f9f27ba..5db8708 100644
--- a/mpz/cmp_ui.c
+++ b/mpz/cmp_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -66,3 +65,4 @@ _mpz_cmp_ui (mpz_srcptr u, unsigned long int v_digit) __GMP_NOTHROW
return un > 0 ? 1 : -1;
}
+__GMP_PUBLIC_DEFINE (_mpz_cmp_ui)
diff --git a/mpz/cmpabs.c b/mpz/cmpabs.c
index f7bbcd7..49ff807 100644
--- a/mpz/cmpabs.c
+++ b/mpz/cmpabs.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -41,3 +40,4 @@ mpz_cmpabs (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
MPN_CMP (cmp, up, vp, usize);
return cmp;
}
+__GMP_PUBLIC_DEFINE (mpz_cmpabs)
diff --git a/mpz/cmpabs_d.c b/mpz/cmpabs_d.c
index a5f2085..d383bf5 100644
--- a/mpz/cmpabs_d.c
+++ b/mpz/cmpabs_d.c
@@ -17,13 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "config.h"
-
-#if HAVE_FLOAT_H
-#include <float.h> /* for DBL_MAX */
-#endif
-
-#include "gmp.h"
#include "gmp-impl.h"
@@ -117,3 +110,4 @@ mpz_cmpabs_d (mpz_srcptr z, double d)
}
#endif
}
+__GMP_PUBLIC_DEFINE (mpz_cmpabs_d)
diff --git a/mpz/cmpabs_ui.c b/mpz/cmpabs_ui.c
index f8df4b8..e7f2f38 100644
--- a/mpz/cmpabs_ui.c
+++ b/mpz/cmpabs_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -65,3 +64,4 @@ mpz_cmpabs_ui (mpz_srcptr u, unsigned long int v_digit) __GMP_NOTHROW
return 1;
}
+__GMP_PUBLIC_DEFINE (mpz_cmpabs_ui)
diff --git a/mpz/com.c b/mpz/com.c
index 9fedfae..da40750 100644
--- a/mpz/com.c
+++ b/mpz/com.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -75,3 +74,4 @@ mpz_com (mpz_ptr dst, mpz_srcptr src)
SIZ (dst) = size;
}
}
+__GMP_PUBLIC_DEFINE (mpz_com)
diff --git a/mpz/combit.c b/mpz/combit.c
index 34f4967..8444f3e 100644
--- a/mpz/combit.c
+++ b/mpz/combit.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -90,3 +89,4 @@ mpz_combit (mpz_ptr d, mp_bitcnt_t bit_index)
}
}
}
+__GMP_PUBLIC_DEFINE (mpz_combit)
diff --git a/mpz/cong.c b/mpz/cong.c
index 8dcf077..ba7ae17 100644
--- a/mpz/cong.c
+++ b/mpz/cong.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* For big divisors this code is only very slightly better than the user
@@ -170,3 +168,4 @@ mpz_congruent_p (mpz_srcptr a, mpz_srcptr c, mpz_srcptr d)
TMP_FREE;
return result;
}
+__GMP_PUBLIC_DEFINE (mpz_congruent_p)
diff --git a/mpz/cong_2exp.c b/mpz/cong_2exp.c
index b4fb080..dc05407 100644
--- a/mpz/cong_2exp.c
+++ b/mpz/cong_2exp.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -142,3 +141,4 @@ mpz_congruent_2exp_p (mpz_srcptr a, mpz_srcptr c, mp_bitcnt_t d) __GMP_NOTHROW
return ((ap[dlimbs]+1) & dmask) == 0;
}
}
+__GMP_PUBLIC_DEFINE (mpz_congruent_2exp_p)
diff --git a/mpz/cong_ui.c b/mpz/cong_ui.c
index 539e95f..6a7e9b7 100644
--- a/mpz/cong_ui.c
+++ b/mpz/cong_ui.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* There's some explicit checks for c<d since it seems reasonably likely an
@@ -103,3 +101,4 @@ mpz_congruent_ui_p (mpz_srcptr a, unsigned long cu, unsigned long du)
r = mpn_modexact_1c_odd (ap, asize, d, c);
return r == 0 || r == d;
}
+__GMP_PUBLIC_DEFINE (mpz_congruent_ui_p)
diff --git a/mpz/dive_ui.c b/mpz/dive_ui.c
index 34f826d..5efea01 100644
--- a/mpz/dive_ui.c
+++ b/mpz/dive_ui.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -56,3 +55,4 @@ mpz_divexact_ui (mpz_ptr dst, mpz_srcptr src, unsigned long divisor)
abs_size -= (dst_ptr[abs_size-1] == 0);
SIZ(dst) = (size >= 0 ? abs_size : -abs_size);
}
+__GMP_PUBLIC_DEFINE (mpz_divexact_ui)
diff --git a/mpz/divegcd.c b/mpz/divegcd.c
index 1069fc6..5993689 100644
--- a/mpz/divegcd.c
+++ b/mpz/divegcd.c
@@ -20,9 +20,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* Set q to a/d, expecting d to be from a GCD and therefore usually small.
@@ -144,3 +142,4 @@ mpz_divexact_gcd (mpz_ptr q, mpz_srcptr a, mpz_srcptr d)
mpz_divexact (q, a, d);
}
+__GMP_INTERN_DEFINE (mpz_divexact_gcd)
diff --git a/mpz/divexact.c b/mpz/divexact.c
index 1e5c3ac..ee658c8 100644
--- a/mpz/divexact.c
+++ b/mpz/divexact.c
@@ -20,10 +20,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
mpz_divexact (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
@@ -78,3 +75,4 @@ mpz_divexact (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_divexact)
diff --git a/mpz/divis.c b/mpz/divis.c
index 78ac38f..ca4d3bd 100644
--- a/mpz/divis.c
+++ b/mpz/divis.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -31,3 +30,4 @@ mpz_divisible_p (mpz_srcptr a, mpz_srcptr d)
return mpn_divisible_p (PTR(a), ABS(asize), PTR(d), ABS(dsize));
}
+__GMP_PUBLIC_DEFINE (mpz_divisible_p)
diff --git a/mpz/divis_2exp.c b/mpz/divis_2exp.c
index 814037f..6c25a1d 100644
--- a/mpz/divis_2exp.c
+++ b/mpz/divis_2exp.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -48,3 +47,4 @@ mpz_divisible_2exp_p (mpz_srcptr a, mp_bitcnt_t d) __GMP_NOTHROW
dmask = (CNST_LIMB(1) << dbits) - 1;
return (ap[dlimbs] & dmask) == 0;
}
+__GMP_PUBLIC_DEFINE (mpz_divisible_2exp_p)
diff --git a/mpz/divis_ui.c b/mpz/divis_ui.c
index 00d0d1f..23cd355 100644
--- a/mpz/divis_ui.c
+++ b/mpz/divis_ui.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
int
@@ -68,3 +66,4 @@ mpz_divisible_ui_p (mpz_srcptr a, unsigned long d)
return mpn_modexact_1_odd (ap, asize, (mp_limb_t) d) == 0;
}
+__GMP_PUBLIC_DEFINE (mpz_divisible_ui_p)
diff --git a/mpz/dump.c b/mpz/dump.c
index c5656a7..4b75748 100644
--- a/mpz/dump.c
+++ b/mpz/dump.c
@@ -22,9 +22,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include <string.h> /* for strlen */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -36,3 +33,4 @@ mpz_dump (mpz_srcptr u)
printf ("%s\n", str);
(*__gmp_free_func) (str, strlen (str) + 1);
}
+__GMP_PUBLIC_DEFINE (mpz_dump)
diff --git a/mpz/export.c b/mpz/export.c
index 6173fb6..2b4ad8d 100644
--- a/mpz/export.c
+++ b/mpz/export.c
@@ -17,10 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
#if HAVE_LIMB_BIG_ENDIAN
@@ -177,3 +174,4 @@ mpz_export (void *data, size_t *countp, int order,
}
return data;
}
+__GMP_PUBLIC_DEFINE (mpz_export)
diff --git a/mpz/fac_ui.c b/mpz/fac_ui.c
index bb7a9c4..c144e61 100644
--- a/mpz/fac_ui.c
+++ b/mpz/fac_ui.c
@@ -20,7 +20,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#define FACTOR_LIST_STORE(P, PR, MAX_PR, VEC, I) \
@@ -93,6 +92,7 @@ mpz_fac_ui (mpz_ptr x, unsigned long n)
mpz_mul_2exp (x, x, count);
}
}
+__GMP_PUBLIC_DEFINE (mpz_fac_ui)
#undef FACTORS_PER_LIMB
#undef FACTOR_LIST_STORE
diff --git a/mpz/fdiv_q.c b/mpz/fdiv_q.c
index 6281b1e..9d2b694 100644
--- a/mpz/fdiv_q.c
+++ b/mpz/fdiv_q.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -41,3 +40,4 @@ mpz_fdiv_q (mpz_ptr quot, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_q)
diff --git a/mpz/fdiv_q_ui.c b/mpz/fdiv_q_ui.c
index 41fa8ab..a5d1fd5 100644
--- a/mpz/fdiv_q_ui.c
+++ b/mpz/fdiv_q_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -88,3 +87,4 @@ mpz_fdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_q_ui)
diff --git a/mpz/fdiv_qr.c b/mpz/fdiv_qr.c
index d486547..ed628bd 100644
--- a/mpz/fdiv_qr.c
+++ b/mpz/fdiv_qr.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -53,3 +52,4 @@ mpz_fdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_qr)
diff --git a/mpz/fdiv_qr_ui.c b/mpz/fdiv_qr_ui.c
index a4e84eb..b83d52b 100644
--- a/mpz/fdiv_qr_ui.c
+++ b/mpz/fdiv_qr_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -105,3 +104,4 @@ mpz_fdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long in
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_qr_ui)
diff --git a/mpz/fdiv_r.c b/mpz/fdiv_r.c
index 706e49e..1f60ef7 100644
--- a/mpz/fdiv_r.c
+++ b/mpz/fdiv_r.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -47,3 +46,4 @@ mpz_fdiv_r (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_r)
diff --git a/mpz/fdiv_r_ui.c b/mpz/fdiv_r_ui.c
index 3d3a00e..27efa06 100644
--- a/mpz/fdiv_r_ui.c
+++ b/mpz/fdiv_r_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -95,3 +94,4 @@ mpz_fdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_r_ui)
diff --git a/mpz/fdiv_ui.c b/mpz/fdiv_ui.c
index c4f4ec9..340fdfd 100644
--- a/mpz/fdiv_ui.c
+++ b/mpz/fdiv_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -88,3 +87,4 @@ mpz_fdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_fdiv_ui)
diff --git a/mpz/fib2_ui.c b/mpz/fib2_ui.c
index 1bd61d1..da70294 100644
--- a/mpz/fib2_ui.c
+++ b/mpz/fib2_ui.c
@@ -17,8 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
@@ -37,3 +35,4 @@ mpz_fib2_ui (mpz_ptr fn, mpz_ptr fnsub1, unsigned long n)
SIZ(fn) = size - (n == 0);
SIZ(fnsub1) = size - (f1p[size-1] == 0);
}
+__GMP_PUBLIC_DEFINE (mpz_fib2_ui)
diff --git a/mpz/fib_ui.c b/mpz/fib_ui.c
index daa77bb..2c79ca6 100644
--- a/mpz/fib_ui.c
+++ b/mpz/fib_ui.c
@@ -17,10 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* change to "#define TRACE(x) x" to get some traces */
@@ -139,3 +136,4 @@ mpz_fib_ui (mpz_ptr fn, unsigned long n)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_fib_ui)
diff --git a/mpz/fits_s.h b/mpz/fits_s.h
index 8c6bae5..833f2a3 100644
--- a/mpz/fits_s.h
+++ b/mpz/fits_s.h
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -48,3 +47,4 @@ FUNCTION (mpz_srcptr z) __GMP_NOTHROW
#endif
return 0;
}
+__GMP_PUBLIC_DEFINE (FUNCTION)
diff --git a/mpz/fits_uint.c b/mpz/fits_uint.c
index c2b95e5..169b0a1 100644
--- a/mpz/fits_uint.c
+++ b/mpz/fits_uint.c
@@ -18,6 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_fits_uint_p 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_fits_uint_p)
diff --git a/mpz/fits_ulong.c b/mpz/fits_ulong.c
index 71013e0..6c659d6 100644
--- a/mpz/fits_ulong.c
+++ b/mpz/fits_ulong.c
@@ -18,6 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_fits_ulong_p 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_fits_ulong_p)
diff --git a/mpz/fits_ushort.c b/mpz/fits_ushort.c
index 47d37cd..16e3e27 100644
--- a/mpz/fits_ushort.c
+++ b/mpz/fits_ushort.c
@@ -18,6 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_fits_ushort_p 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_fits_ushort_p)
diff --git a/mpz/gcd.c b/mpz/gcd.c
index 688b739..13599aa 100644
--- a/mpz/gcd.c
+++ b/mpz/gcd.c
@@ -18,9 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
@@ -154,3 +152,4 @@ mpz_gcd (mpz_ptr g, mpz_srcptr u, mpz_srcptr v)
SIZ (g) = gsize;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_gcd)
diff --git a/mpz/gcd_ui.c b/mpz/gcd_ui.c
index d1a7cec..2a2f138 100644
--- a/mpz/gcd_ui.c
+++ b/mpz/gcd_ui.c
@@ -18,8 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -73,3 +71,4 @@ mpz_gcd_ui (mpz_ptr w, mpz_srcptr u, unsigned long int v)
}
return res;
}
+__GMP_PUBLIC_DEFINE (mpz_gcd_ui)
diff --git a/mpz/gcdext.c b/mpz/gcdext.c
index e284fbd..95801be 100644
--- a/mpz/gcdext.c
+++ b/mpz/gcdext.c
@@ -19,8 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -111,3 +109,4 @@ mpz_gcdext (mpz_ptr g, mpz_ptr s, mpz_ptr t, mpz_srcptr a, mpz_srcptr b)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_gcdext)
diff --git a/mpz/get_d.c b/mpz/get_d.c
index 5643e21..42adbcf 100644
--- a/mpz/get_d.c
+++ b/mpz/get_d.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
double
@@ -31,3 +30,4 @@ mpz_get_d (mpz_srcptr z)
return mpn_get_d (PTR (z), ABS (size), size, 0L);
}
+__GMP_PUBLIC_DEFINE (mpz_get_d)
diff --git a/mpz/get_d_2exp.c b/mpz/get_d_2exp.c
index b2e2e51..e94a93a 100644
--- a/mpz/get_d_2exp.c
+++ b/mpz/get_d_2exp.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
double
mpz_get_d_2exp (signed long int *exp2, mpz_srcptr src)
@@ -41,3 +39,4 @@ mpz_get_d_2exp (signed long int *exp2, mpz_srcptr src)
*exp2 = exp;
return mpn_get_d (ptr, abs_size, size, -exp);
}
+__GMP_PUBLIC_DEFINE (mpz_get_d_2exp)
diff --git a/mpz/get_si.c b/mpz/get_si.c
index f609d48..a639917 100644
--- a/mpz/get_si.c
+++ b/mpz/get_si.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
signed long int
@@ -41,3 +40,4 @@ mpz_get_si (mpz_srcptr z) __GMP_NOTHROW
else
return 0;
}
+__GMP_PUBLIC_DEFINE (mpz_get_si)
diff --git a/mpz/get_str.c b/mpz/get_str.c
index 70ad589..aea415e 100644
--- a/mpz/get_str.c
+++ b/mpz/get_str.c
@@ -22,10 +22,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <string.h> /* for strlen */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
char *
mpz_get_str (char *res_str, int base, mpz_srcptr x)
@@ -106,3 +103,4 @@ mpz_get_str (char *res_str, int base, mpz_srcptr x)
}
return return_str;
}
+__GMP_PUBLIC_DEFINE (mpz_get_str)
diff --git a/mpz/get_ui.c b/mpz/get_ui.c
index a94af63..6247c88 100644
--- a/mpz/get_ui.c
+++ b/mpz/get_ui.c
@@ -18,6 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_get_ui 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_get_ui)
diff --git a/mpz/getlimbn.c b/mpz/getlimbn.c
index dc7771e..3c61ded 100644
--- a/mpz/getlimbn.c
+++ b/mpz/getlimbn.c
@@ -18,6 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_getlimbn 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_getlimbn)
diff --git a/mpz/hamdist.c b/mpz/hamdist.c
index 5c62e0b..5c4d7bb 100644
--- a/mpz/hamdist.c
+++ b/mpz/hamdist.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -163,3 +162,4 @@ mpz_hamdist (mpz_srcptr u, mpz_srcptr v) __GMP_NOTHROW
return count;
}
}
+__GMP_PUBLIC_DEFINE (mpz_hamdist)
diff --git a/mpz/import.c b/mpz/import.c
index a3f0cc9..33711a1 100644
--- a/mpz/import.c
+++ b/mpz/import.c
@@ -17,8 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
@@ -167,3 +165,4 @@ mpz_import (mpz_ptr z, size_t count, int order,
MPN_NORMALIZE (zp, zsize);
SIZ(z) = zsize;
}
+__GMP_PUBLIC_DEFINE (mpz_import)
diff --git a/mpz/init.c b/mpz/init.c
index 1ad55b4..fee1bb9 100644
--- a/mpz/init.c
+++ b/mpz/init.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -33,3 +32,4 @@ mpz_init (mpz_ptr x)
PTR (x) = 0;
#endif
}
+__GMP_PUBLIC_DEFINE (mpz_init)
diff --git a/mpz/init2.c b/mpz/init2.c
index a516b0a..d70e4c7 100644
--- a/mpz/init2.c
+++ b/mpz/init2.c
@@ -17,9 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdlib.h>
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -48,3 +45,4 @@ mpz_init2 (mpz_ptr x, mp_bitcnt_t bits)
PTR(x)[0] = 0;
#endif
}
+__GMP_PUBLIC_DEFINE (mpz_init2)
diff --git a/mpz/inits.c b/mpz/inits.c
index 9ca0e8c..50ff1e9 100644
--- a/mpz/inits.c
+++ b/mpz/inits.c
@@ -17,16 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "config.h"
-
-#if HAVE_STDARG
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -54,3 +44,4 @@ mpz_inits (va_alist)
}
va_end (ap);
}
+__GMP_PUBLIC_DEFINE (mpz_inits)
diff --git a/mpz/inp_raw.c b/mpz/inp_raw.c
index dddce96..9508528 100644
--- a/mpz/inp_raw.c
+++ b/mpz/inp_raw.c
@@ -17,8 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
@@ -160,3 +158,4 @@ mpz_inp_raw (mpz_ptr x, FILE *fp)
SIZ(x) = (csize >= 0 ? abs_xsize : -abs_xsize);
return abs_csize + 4;
}
+__GMP_PUBLIC_DEFINE (mpz_inp_raw)
diff --git a/mpz/inp_str.c b/mpz/inp_str.c
index b85f682..84278e6 100644
--- a/mpz/inp_str.c
+++ b/mpz/inp_str.c
@@ -23,11 +23,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include <ctype.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
#define digit_value_tab __gmp_digit_value_tab
@@ -161,3 +157,4 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread)
(*__gmp_free_func) (str, alloc_size);
return nread;
}
+__GMP_PUBLIC_DEFINE (mpz_inp_str)
diff --git a/mpz/invert.c b/mpz/invert.c
index 18bdff8..2aa3ee0 100644
--- a/mpz/invert.c
+++ b/mpz/invert.c
@@ -20,7 +20,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -66,3 +65,4 @@ mpz_invert (mpz_ptr inverse, mpz_srcptr x, mpz_srcptr n)
TMP_FREE;
return 1;
}
+__GMP_PUBLIC_DEFINE (mpz_invert)
diff --git a/mpz/ior.c b/mpz/ior.c
index 1d77054..87da925 100644
--- a/mpz/ior.c
+++ b/mpz/ior.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -217,3 +216,4 @@ mpz_ior (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
}
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_ior)
diff --git a/mpz/iset.c b/mpz/iset.c
index 9c8c934..7156f6a 100644
--- a/mpz/iset.c
+++ b/mpz/iset.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -46,3 +45,4 @@ mpz_init_set (mpz_ptr w, mpz_srcptr u)
wp[0] = 0;
#endif
}
+__GMP_PUBLIC_DEFINE (mpz_init_set)
diff --git a/mpz/iset_d.c b/mpz/iset_d.c
index 19c245e..b3c3045 100644
--- a/mpz/iset_d.c
+++ b/mpz/iset_d.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -29,3 +28,4 @@ mpz_init_set_d (mpz_ptr dest, double val)
SIZ (dest) = 0;
mpz_set_d (dest, val);
}
+__GMP_PUBLIC_DEFINE (mpz_init_set_d)
diff --git a/mpz/iset_si.c b/mpz/iset_si.c
index ab53e34..7f27483 100644
--- a/mpz/iset_si.c
+++ b/mpz/iset_si.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -47,3 +46,4 @@ mpz_init_set_si (mpz_ptr dest, signed long int val)
SIZ (dest) = val >= 0 ? size : -size;
}
+__GMP_PUBLIC_DEFINE (mpz_init_set_si)
diff --git a/mpz/iset_str.c b/mpz/iset_str.c
index 5a0ec7d..c6f8044 100644
--- a/mpz/iset_str.c
+++ b/mpz/iset_str.c
@@ -23,7 +23,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -42,3 +41,4 @@ mpz_init_set_str (mpz_ptr x, const char *str, int base)
return mpz_set_str (x, str, base);
}
+__GMP_PUBLIC_DEFINE (mpz_init_set_str)
diff --git a/mpz/iset_ui.c b/mpz/iset_ui.c
index 3090f08..fc0b15d 100644
--- a/mpz/iset_ui.c
+++ b/mpz/iset_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -47,3 +46,4 @@ mpz_init_set_ui (mpz_ptr dest, unsigned long int val)
SIZ (dest) = size;
}
+__GMP_PUBLIC_DEFINE (mpz_init_set_ui)
diff --git a/mpz/jacobi.c b/mpz/jacobi.c
index 0a8fb29..5bd8e0d 100644
--- a/mpz/jacobi.c
+++ b/mpz/jacobi.c
@@ -18,10 +18,7 @@ for more details.
You should have received a copy of the GNU Lesser General Public License along
with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* This code does triple duty as mpz_jacobi, mpz_legendre and
@@ -199,3 +196,4 @@ mpz_jacobi (mpz_srcptr a, mpz_srcptr b)
TMP_FREE;
return res;
}
+__GMP_PUBLIC_DEFINE (mpz_jacobi)
diff --git a/mpz/kronsz.c b/mpz/kronsz.c
index fd9c090..8b13161 100644
--- a/mpz/kronsz.c
+++ b/mpz/kronsz.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
int
@@ -125,3 +123,4 @@ mpz_si_kronecker (long a, mpz_srcptr b)
result_bit1 ^= JACOBI_RECIP_UU_BIT1 (a_limb, b_low);
return mpn_jacobi_base (b_rem, a_limb, result_bit1);
}
+__GMP_PUBLIC_DEFINE (mpz_si_kronecker)
diff --git a/mpz/kronuz.c b/mpz/kronuz.c
index ece0bfb..b4f5eae 100644
--- a/mpz/kronuz.c
+++ b/mpz/kronuz.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
int
@@ -117,3 +115,4 @@ mpz_ui_kronecker (unsigned long a, mpz_srcptr b)
result_bit1 ^= JACOBI_RECIP_UU_BIT1 (a, b_low);
return mpn_jacobi_base (b_rem, (mp_limb_t) a, result_bit1);
}
+__GMP_PUBLIC_DEFINE (mpz_ui_kronecker)
diff --git a/mpz/kronzs.c b/mpz/kronzs.c
index 783f9e8..6e0fb13 100644
--- a/mpz/kronzs.c
+++ b/mpz/kronzs.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* After the absolute value of b is established it's treated as an unsigned
@@ -80,3 +78,4 @@ mpz_kronecker_si (mpz_srcptr a, long b)
JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, a_rem, a_ptr, a_size, b_limb);
return mpn_jacobi_base (a_rem, b_limb, result_bit1);
}
+__GMP_PUBLIC_DEFINE (mpz_kronecker_si)
diff --git a/mpz/kronzu.c b/mpz/kronzu.c
index 9b0eb1e..7daa0e3 100644
--- a/mpz/kronzu.c
+++ b/mpz/kronzu.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
int
@@ -76,3 +74,4 @@ mpz_kronecker_ui (mpz_srcptr a, unsigned long b)
JACOBI_MOD_OR_MODEXACT_1_ODD (result_bit1, a_rem, a_ptr, a_size, b);
return mpn_jacobi_base (a_rem, (mp_limb_t) b, result_bit1);
}
+__GMP_PUBLIC_DEFINE (mpz_kronecker_ui)
diff --git a/mpz/lcm.c b/mpz/lcm.c
index e871ca1..1fff4bb 100644
--- a/mpz/lcm.c
+++ b/mpz/lcm.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -75,3 +74,4 @@ mpz_lcm (mpz_ptr r, mpz_srcptr u, mpz_srcptr v)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_lcm)
diff --git a/mpz/lcm_ui.c b/mpz/lcm_ui.c
index 2249aac..7f5a855 100644
--- a/mpz/lcm_ui.c
+++ b/mpz/lcm_ui.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
@@ -66,3 +64,4 @@ mpz_lcm_ui (mpz_ptr r, mpz_srcptr u, unsigned long v)
usize += (c != 0);
SIZ(r) = usize;
}
+__GMP_PUBLIC_DEFINE (mpz_lcm_ui)
diff --git a/mpz/limbs_finish.c b/mpz/limbs_finish.c
index ec78096..b725d19 100644
--- a/mpz/limbs_finish.c
+++ b/mpz/limbs_finish.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -27,3 +26,4 @@ mpz_limbs_finish (mpz_ptr x, mp_size_t xs)
MPN_NORMALIZE (PTR (x), xn);
SIZ (x) = xs < 0 ? -xn : xn;
}
+__GMP_PUBLIC_DEFINE (mpz_limbs_finish)
diff --git a/mpz/limbs_modify.c b/mpz/limbs_modify.c
index 23da9b6..7508358 100644
--- a/mpz/limbs_modify.c
+++ b/mpz/limbs_modify.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_ptr
@@ -26,3 +25,4 @@ mpz_limbs_modify (mpz_ptr x, mp_size_t n)
ASSERT (n > 0);
return MPZ_REALLOC (x, n);
}
+__GMP_PUBLIC_DEFINE (mpz_limbs_modify)
diff --git a/mpz/limbs_read.c b/mpz/limbs_read.c
index 5024b83..96b7d85 100644
--- a/mpz/limbs_read.c
+++ b/mpz/limbs_read.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_srcptr
@@ -25,3 +24,4 @@ mpz_limbs_read (mpz_srcptr x)
{
return PTR(x);
}
+__GMP_PUBLIC_DEFINE (mpz_limbs_read)
diff --git a/mpz/limbs_write.c b/mpz/limbs_write.c
index 025ebef..f1f7f4d 100644
--- a/mpz/limbs_write.c
+++ b/mpz/limbs_write.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_ptr
@@ -26,3 +25,4 @@ mpz_limbs_write (mpz_ptr x, mp_size_t n)
ASSERT (n > 0);
return MPZ_NEWALLOC (x, n);
}
+__GMP_PUBLIC_DEFINE (mpz_limbs_write)
diff --git a/mpz/lucnum2_ui.c b/mpz/lucnum2_ui.c
index fa09d5c..e12f0b7 100644
--- a/mpz/lucnum2_ui.c
+++ b/mpz/lucnum2_ui.c
@@ -17,8 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
@@ -77,3 +75,4 @@ mpz_lucnum2_ui (mpz_ptr ln, mpz_ptr lnsub1, unsigned long n)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_lucnum2_ui)
diff --git a/mpz/lucnum_ui.c b/mpz/lucnum_ui.c
index cf0b7c5..fc49103 100644
--- a/mpz/lucnum_ui.c
+++ b/mpz/lucnum_ui.c
@@ -17,8 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
@@ -196,3 +194,4 @@ mpz_lucnum_ui (mpz_ptr ln, unsigned long n)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_lucnum_ui)
diff --git a/mpz/mfac_uiui.c b/mpz/mfac_uiui.c
index 784c5f9..50db89b 100644
--- a/mpz/mfac_uiui.c
+++ b/mpz/mfac_uiui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*************************************************************/
@@ -127,3 +126,4 @@ mpz_mfac_uiui (mpz_ptr x, unsigned long n, unsigned long m)
}
}
}
+__GMP_PUBLIC_DEFINE (mpz_mfac_uiui)
diff --git a/mpz/millerrabin.c b/mpz/millerrabin.c
index bf6a9a6..639679e 100644
--- a/mpz/millerrabin.c
+++ b/mpz/millerrabin.c
@@ -27,7 +27,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
static int millerrabin (mpz_srcptr, mpz_srcptr,
@@ -88,6 +87,7 @@ mpz_millerrabin (mpz_srcptr n, int reps)
TMP_FREE;
return is_prime;
}
+__GMP_PUBLIC_DEFINE (mpz_millerrabin)
static int
millerrabin (mpz_srcptr n, mpz_srcptr nm1, mpz_ptr x, mpz_ptr y,
diff --git a/mpz/mod.c b/mpz/mod.c
index cf0fe26..bf1c841 100644
--- a/mpz/mod.c
+++ b/mpz/mod.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -55,3 +54,4 @@ mpz_mod (mpz_ptr rem, mpz_srcptr dividend, mpz_srcptr divisor)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_mod)
diff --git a/mpz/mul.c b/mpz/mul.c
index 71c62e0..f31c9b2 100644
--- a/mpz/mul.c
+++ b/mpz/mul.c
@@ -18,8 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -144,3 +142,4 @@ mpz_mul (mpz_ptr w, mpz_srcptr u, mpz_srcptr v)
(*__gmp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_mul)
diff --git a/mpz/mul_2exp.c b/mpz/mul_2exp.c
index 4e1f4e6..f0f52cd 100644
--- a/mpz/mul_2exp.c
+++ b/mpz/mul_2exp.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -60,3 +59,4 @@ mpz_mul_2exp (mpz_ptr r, mpz_srcptr u, mp_bitcnt_t cnt)
SIZ(r) = SIZ(u) >= 0 ? rn : -rn;
}
+__GMP_PUBLIC_DEFINE (mpz_mul_2exp)
diff --git a/mpz/mul_i.h b/mpz/mul_i.h
index 868c90d..6866a17 100644
--- a/mpz/mul_i.h
+++ b/mpz/mul_i.h
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -94,3 +93,4 @@ FUNCTION (mpz_ptr prod, mpz_srcptr mult,
SIZ(prod) = ((sign_product < 0) ^ (small_mult < 0)) ? -size : size;
}
+__GMP_PUBLIC_DEFINE (FUNCTION)
diff --git a/mpz/n_pow_ui.c b/mpz/n_pow_ui.c
index 1a457b6..0794ead 100644
--- a/mpz/n_pow_ui.c
+++ b/mpz/n_pow_ui.c
@@ -21,9 +21,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* Change this to "#define TRACE(x) x" for some traces. */
@@ -520,3 +518,4 @@ mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, unsigned long int e)
rsize += rtwos_limbs;
SIZ(r) = (rneg ? -rsize : rsize);
}
+__GMP_INTERN_DEFINE (mpz_n_pow_ui)
diff --git a/mpz/neg.c b/mpz/neg.c
index caf2df5..3cb94e8 100644
--- a/mpz/neg.c
+++ b/mpz/neg.c
@@ -18,8 +18,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_neg 1
-
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -44,3 +42,4 @@ mpz_neg (mpz_ptr w, mpz_srcptr u)
SIZ (w) = -usize;
}
+__GMP_PUBLIC_DEFINE (mpz_neg)
diff --git a/mpz/nextprime.c b/mpz/nextprime.c
index c1af45a..a0a2da3 100644
--- a/mpz/nextprime.c
+++ b/mpz/nextprime.c
@@ -19,9 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
static const unsigned char primegap[] =
{
@@ -116,3 +114,4 @@ mpz_nextprime (mpz_ptr p, mpz_srcptr n)
done:
TMP_SFREE;
}
+__GMP_PUBLIC_DEFINE (mpz_nextprime)
diff --git a/mpz/oddfac_1.c b/mpz/oddfac_1.c
index e1ce119..28e4994 100644
--- a/mpz/oddfac_1.c
+++ b/mpz/oddfac_1.c
@@ -24,9 +24,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* TODO:
- split this file in smaller parts with functions that can be recycled for different computations.
@@ -411,6 +409,7 @@ mpz_oddfac_1 (mpz_ptr x, mp_limb_t n, unsigned flag)
}
}
}
+__GMP_INTERN_DEFINE (mpz_oddfac_1)
#undef FACTORS_PER_LIMB
#undef FACTOR_LIST_STORE
diff --git a/mpz/out_raw.c b/mpz/out_raw.c
index ed3330a..12c545c 100644
--- a/mpz/out_raw.c
+++ b/mpz/out_raw.c
@@ -17,10 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* HTON_LIMB_STORE takes a normal host byte order limb and stores it as
@@ -160,3 +157,4 @@ mpz_out_raw (FILE *fp, mpz_srcptr x)
(*__gmp_free_func) (tp, tsize);
return ssize;
}
+__GMP_PUBLIC_DEFINE (mpz_out_raw)
diff --git a/mpz/out_str.c b/mpz/out_str.c
index 3fd0666..43d5f73 100644
--- a/mpz/out_str.c
+++ b/mpz/out_str.c
@@ -19,10 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
size_t
mpz_out_str (FILE *stream, int base, mpz_srcptr x)
@@ -99,3 +96,4 @@ mpz_out_str (FILE *stream, int base, mpz_srcptr x)
TMP_FREE;
return ferror (stream) ? 0 : written;
}
+__GMP_PUBLIC_DEFINE (mpz_out_str)
diff --git a/mpz/perfpow.c b/mpz/perfpow.c
index 81c8884..526019a 100644
--- a/mpz/perfpow.c
+++ b/mpz/perfpow.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -27,3 +26,4 @@ mpz_perfect_power_p (mpz_srcptr u)
{
return mpn_perfect_power_p (PTR (u), SIZ (u));
}
+__GMP_PUBLIC_DEFINE (mpz_perfect_power_p)
diff --git a/mpz/perfsqr.c b/mpz/perfsqr.c
index b4853b5..c3f21b6 100644
--- a/mpz/perfsqr.c
+++ b/mpz/perfsqr.c
@@ -19,6 +19,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_perfect_square_p 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_perfect_square_p)
diff --git a/mpz/popcount.c b/mpz/popcount.c
index c8d9bec..41856e6 100644
--- a/mpz/popcount.c
+++ b/mpz/popcount.c
@@ -19,6 +19,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_popcount 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_popcount)
diff --git a/mpz/pow_ui.c b/mpz/pow_ui.c
index ae0307d..08b2aac 100644
--- a/mpz/pow_ui.c
+++ b/mpz/pow_ui.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -40,3 +39,4 @@ mpz_pow_ui (mpz_ptr r, mpz_srcptr b, unsigned long int e)
mpz_n_pow_ui (r, PTR(b), (mp_size_t) SIZ(b), e);
}
}
+__GMP_PUBLIC_DEFINE (mpz_pow_ui)
diff --git a/mpz/powm.c b/mpz/powm.c
index 6e33da1..145c735 100644
--- a/mpz/powm.c
+++ b/mpz/powm.c
@@ -21,9 +21,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* TODO
@@ -270,3 +268,4 @@ mpz_powm (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_powm)
diff --git a/mpz/powm_sec.c b/mpz/powm_sec.c
index 895ca89..7a49f40 100644
--- a/mpz/powm_sec.c
+++ b/mpz/powm_sec.c
@@ -21,7 +21,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -85,3 +84,4 @@ mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_powm_sec)
diff --git a/mpz/powm_ui.c b/mpz/powm_ui.c
index cf90dd3..a6d0d15 100644
--- a/mpz/powm_ui.c
+++ b/mpz/powm_ui.c
@@ -21,9 +21,7 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* This code is very old, and should be rewritten to current GMP standard. It
@@ -268,3 +266,4 @@ mpz_powm_ui (mpz_ptr r, mpz_srcptr b, unsigned long int el, mpz_srcptr m)
mpz_powm (r, b, e, m);
}
}
+__GMP_PUBLIC_DEFINE (mpz_powm_ui)
diff --git a/mpz/pprime_p.c b/mpz/pprime_p.c
index 8a642df..174929d 100644
--- a/mpz/pprime_p.c
+++ b/mpz/pprime_p.c
@@ -24,9 +24,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
static int isprime (unsigned long int);
@@ -134,6 +132,7 @@ mpz_probab_prime_p (mpz_srcptr n, int reps)
/* Perform a number of Miller-Rabin tests. */
return mpz_millerrabin (n, reps);
}
+__GMP_PUBLIC_DEFINE (mpz_probab_prime_p)
static int
isprime (unsigned long int t)
diff --git a/mpz/primorial_ui.c b/mpz/primorial_ui.c
index addbb4a..dd77e01 100644
--- a/mpz/primorial_ui.c
+++ b/mpz/primorial_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* TODO: Remove duplicated constants / macros / static functions...
@@ -151,3 +150,4 @@ mpz_primorial_ui (mpz_ptr x, unsigned long n)
TMP_FREE;
}
}
+__GMP_PUBLIC_DEFINE (mpz_primorial_ui)
diff --git a/mpz/prodlimbs.c b/mpz/prodlimbs.c
index 8676887..bea0f99 100644
--- a/mpz/prodlimbs.c
+++ b/mpz/prodlimbs.c
@@ -24,7 +24,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*********************************************************/
@@ -96,3 +95,4 @@ mpz_prodlimbs (mpz_ptr x, mp_ptr factors, mp_size_t j)
return SIZ (x) = size - (cy == 0);
}
}
+__GMP_INTERN_DEFINE (mpz_prodlimbs)
diff --git a/mpz/random.c b/mpz/random.c
index 8bf2a36..c014cc7 100644
--- a/mpz/random.c
+++ b/mpz/random.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -27,3 +26,4 @@ mpz_random (mpz_ptr x, mp_size_t size)
if (size < 0)
SIZ(x) = -SIZ(x);
}
+__GMP_PUBLIC_DEFINE (mpz_random)
diff --git a/mpz/random2.c b/mpz/random2.c
index cc4cfef..0d86c3c 100644
--- a/mpz/random2.c
+++ b/mpz/random2.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -38,3 +37,4 @@ mpz_random2 (mpz_ptr x, mp_size_t size)
SIZ (x) = size;
}
+__GMP_PUBLIC_DEFINE (mpz_random2)
diff --git a/mpz/realloc.c b/mpz/realloc.c
index 0a6d163..e72edd1 100644
--- a/mpz/realloc.c
+++ b/mpz/realloc.c
@@ -18,9 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdlib.h>
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
void *
@@ -59,3 +56,4 @@ _mpz_realloc (mpz_ptr m, mp_size_t new_alloc)
return (void *) mp;
}
+__GMP_PUBLIC_DEFINE (_mpz_realloc)
diff --git a/mpz/realloc2.c b/mpz/realloc2.c
index 84295f6..3b170b8 100644
--- a/mpz/realloc2.c
+++ b/mpz/realloc2.c
@@ -17,9 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdlib.h>
-#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -47,3 +44,4 @@ mpz_realloc2 (mpz_ptr m, mp_bitcnt_t bits)
if (ABSIZ(m) > new_alloc)
SIZ(m) = 0;
}
+__GMP_PUBLIC_DEFINE (mpz_realloc2)
diff --git a/mpz/remove.c b/mpz/remove.c
index 2a4a65c..f52e342 100644
--- a/mpz/remove.c
+++ b/mpz/remove.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_bitcnt_t
@@ -134,3 +133,4 @@ mpz_remove (mpz_ptr dest, mpz_srcptr src, mpz_srcptr f)
return pwr;
}
+__GMP_PUBLIC_DEFINE (mpz_remove)
diff --git a/mpz/roinit_n.c b/mpz/roinit_n.c
index 4d66420..e9839b4 100644
--- a/mpz/roinit_n.c
+++ b/mpz/roinit_n.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mpz_srcptr
@@ -31,3 +30,4 @@ mpz_roinit_n (mpz_ptr x, mp_srcptr xp, mp_size_t xs)
PTR (x) = (mp_ptr) xp;
return x;
}
+__GMP_PUBLIC_DEFINE (mpz_roinit_n)
diff --git a/mpz/root.c b/mpz/root.c
index 90c228f..a21939d 100644
--- a/mpz/root.c
+++ b/mpz/root.c
@@ -18,8 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -80,3 +78,4 @@ mpz_root (mpz_ptr root, mpz_srcptr u, unsigned long int nth)
TMP_FREE;
return remn == 0;
}
+__GMP_PUBLIC_DEFINE (mpz_root)
diff --git a/mpz/rootrem.c b/mpz/rootrem.c
index 267fb33..e2418df 100644
--- a/mpz/rootrem.c
+++ b/mpz/rootrem.c
@@ -18,8 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -88,3 +86,4 @@ mpz_rootrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr u, unsigned long int nth)
SIZ(rem) = us >= 0 ? remn : -remn;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_rootrem)
diff --git a/mpz/rrandomb.c b/mpz/rrandomb.c
index 739d14c..44c4891 100644
--- a/mpz/rrandomb.c
+++ b/mpz/rrandomb.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
static void gmp_rrandomb (mp_ptr, gmp_randstate_t, mp_bitcnt_t);
@@ -39,6 +38,7 @@ mpz_rrandomb (mpz_ptr x, gmp_randstate_t rstate, mp_bitcnt_t nbits)
SIZ(x) = nl;
}
+__GMP_PUBLIC_DEFINE (mpz_rrandomb)
/* Ask _gmp_rand for 32 bits per call unless that's more than a limb can hold.
Thus, we get the same random number sequence in the common cases.
diff --git a/mpz/scan0.c b/mpz/scan0.c
index ac081a6..168757d 100644
--- a/mpz/scan0.c
+++ b/mpz/scan0.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* mpn_scan0 can't be used for the u>0 search since there might not be a 0
@@ -117,3 +115,4 @@ mpz_scan0 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW
count_trailing_zeros (cnt, limb);
return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt;
}
+__GMP_PUBLIC_DEFINE (mpz_scan0)
diff --git a/mpz/scan1.c b/mpz/scan1.c
index e9bfaca..8927d77 100644
--- a/mpz/scan1.c
+++ b/mpz/scan1.c
@@ -17,9 +17,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
/* mpn_scan0 can't be used for the inverted u<0 search since there might not
@@ -111,3 +109,4 @@ mpz_scan1 (mpz_srcptr u, mp_bitcnt_t starting_bit) __GMP_NOTHROW
count_trailing_zeros (cnt, limb);
return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt;
}
+__GMP_PUBLIC_DEFINE (mpz_scan1)
diff --git a/mpz/set.c b/mpz/set.c
index 2014060..243602b 100644
--- a/mpz/set.c
+++ b/mpz/set.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -37,3 +36,4 @@ mpz_set (mpz_ptr w, mpz_srcptr u)
MPN_COPY (wp, up, size);
SIZ(w) = usize;
}
+__GMP_PUBLIC_DEFINE (mpz_set)
diff --git a/mpz/set_d.c b/mpz/set_d.c
index b5f3b93..96226cd 100644
--- a/mpz/set_d.c
+++ b/mpz/set_d.c
@@ -18,13 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "config.h"
-
-#if HAVE_FLOAT_H
-#include <float.h> /* for DBL_MAX */
-#endif
-
-#include "gmp.h"
#include "gmp-impl.h"
@@ -105,3 +98,4 @@ mpz_set_d (mpz_ptr r, double d)
SIZ(r) = negative ? -rn : rn;
}
+__GMP_PUBLIC_DEFINE (mpz_set_d)
diff --git a/mpz/set_f.c b/mpz/set_f.c
index 3ea14e3..2473ab0 100644
--- a/mpz/set_f.c
+++ b/mpz/set_f.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -59,3 +58,4 @@ mpz_set_f (mpz_ptr w, mpf_srcptr u)
MPN_COPY (wp, up, size);
}
+__GMP_PUBLIC_DEFINE (mpz_set_f)
diff --git a/mpz/set_q.c b/mpz/set_q.c
index 13e59ae..069d172 100644
--- a/mpz/set_q.c
+++ b/mpz/set_q.c
@@ -19,6 +19,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_set_q 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_set_q)
diff --git a/mpz/set_si.c b/mpz/set_si.c
index 7dcc5b9..187f368 100644
--- a/mpz/set_si.c
+++ b/mpz/set_si.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -43,3 +42,4 @@ mpz_set_si (mpz_ptr dest, signed long int val)
SIZ (dest) = val >= 0 ? size : -size;
}
+__GMP_PUBLIC_DEFINE (mpz_set_si)
diff --git a/mpz/set_str.c b/mpz/set_str.c
index 03fc064..8c504ee 100644
--- a/mpz/set_str.c
+++ b/mpz/set_str.c
@@ -22,11 +22,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <string.h>
-#include <ctype.h>
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
#define digit_value_tab __gmp_digit_value_tab
@@ -132,3 +128,4 @@ mpz_set_str (mpz_ptr x, const char *str, int base)
TMP_FREE;
return 0;
}
+__GMP_PUBLIC_DEFINE (mpz_set_str)
diff --git a/mpz/set_ui.c b/mpz/set_ui.c
index 3c19311..394e89d 100644
--- a/mpz/set_ui.c
+++ b/mpz/set_ui.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -40,3 +39,4 @@ mpz_set_ui (mpz_ptr dest, unsigned long int val)
SIZ (dest) = size;
}
+__GMP_PUBLIC_DEFINE (mpz_set_ui)
diff --git a/mpz/setbit.c b/mpz/setbit.c
index a4948d3..41fca40 100644
--- a/mpz/setbit.c
+++ b/mpz/setbit.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -92,3 +91,4 @@ mpz_setbit (mpz_ptr d, mp_bitcnt_t bit_idx)
}
}
}
+__GMP_PUBLIC_DEFINE (mpz_setbit)
diff --git a/mpz/size.c b/mpz/size.c
index b310228..75bebdd 100644
--- a/mpz/size.c
+++ b/mpz/size.c
@@ -19,6 +19,6 @@ You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#define __GMP_FORCE_mpz_size 1
-
-#include "gmp.h"
#include "gmp-impl.h"
+
+__GMP_PUBLIC_DEFINE (mpz_size)
diff --git a/mpz/sizeinbase.c b/mpz/sizeinbase.c
index d70e878..5dbed4c 100644
--- a/mpz/sizeinbase.c
+++ b/mpz/sizeinbase.c
@@ -19,9 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
size_t
mpz_sizeinbase (mpz_srcptr x, int base) __GMP_NOTHROW
@@ -30,3 +28,4 @@ mpz_sizeinbase (mpz_srcptr x, int base) __GMP_NOTHROW
MPN_SIZEINBASE (result, PTR(x), ABSIZ(x), base);
return result;
}
+__GMP_PUBLIC_DEFINE (mpz_sizeinbase)
diff --git a/mpz/sqrt.c b/mpz/sqrt.c
index 9a4f8cb..0bd7102 100644
--- a/mpz/sqrt.c
+++ b/mpz/sqrt.c
@@ -18,8 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -64,3 +62,4 @@ mpz_sqrt (mpz_ptr root, mpz_srcptr op)
mpn_sqrtrem (root_ptr, NULL, op_ptr, op_size);
}
}
+__GMP_PUBLIC_DEFINE (mpz_sqrt)
diff --git a/mpz/sqrtrem.c b/mpz/sqrtrem.c
index 76abdc0..20e4932 100644
--- a/mpz/sqrtrem.c
+++ b/mpz/sqrtrem.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -72,3 +71,4 @@ mpz_sqrtrem (mpz_ptr root, mpz_ptr rem, mpz_srcptr op)
remainder, when passed ROOT == REM. */
SIZ (rem) = rem_size;
}
+__GMP_PUBLIC_DEFINE (mpz_sqrtrem)
diff --git a/mpz/swap.c b/mpz/swap.c
index 73348fe..bea916d 100644
--- a/mpz/swap.c
+++ b/mpz/swap.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -42,3 +41,4 @@ mpz_swap (mpz_ptr u, mpz_ptr v) __GMP_NOTHROW
PTR (v) = up;
PTR (u) = vp;
}
+__GMP_PUBLIC_DEFINE (mpz_swap)
diff --git a/mpz/tdiv_q.c b/mpz/tdiv_q.c
index 6c6b65c..5c020b9 100644
--- a/mpz/tdiv_q.c
+++ b/mpz/tdiv_q.c
@@ -18,9 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
mpz_tdiv_q (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
@@ -80,3 +78,4 @@ mpz_tdiv_q (mpz_ptr quot, mpz_srcptr num, mpz_srcptr den)
SIZ (quot) = (ns ^ ds) >= 0 ? ql : -ql;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_q)
diff --git a/mpz/tdiv_q_2exp.c b/mpz/tdiv_q_2exp.c
index 88c4ded..08e6e31 100644
--- a/mpz/tdiv_q_2exp.c
+++ b/mpz/tdiv_q_2exp.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -55,3 +54,4 @@ mpz_tdiv_q_2exp (mpz_ptr r, mpz_srcptr u, mp_bitcnt_t cnt)
SIZ(r) = un >= 0 ? rn : -rn;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_q_2exp)
diff --git a/mpz/tdiv_q_ui.c b/mpz/tdiv_q_ui.c
index 6d28794..be1002f 100644
--- a/mpz/tdiv_q_ui.c
+++ b/mpz/tdiv_q_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -71,3 +70,4 @@ mpz_tdiv_q_ui (mpz_ptr quot, mpz_srcptr dividend, unsigned long int divisor)
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_q_ui)
diff --git a/mpz/tdiv_qr.c b/mpz/tdiv_qr.c
index cfbc7d9..6ead695 100644
--- a/mpz/tdiv_qr.c
+++ b/mpz/tdiv_qr.c
@@ -19,9 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
mpz_tdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
@@ -94,3 +92,4 @@ mpz_tdiv_qr (mpz_ptr quot, mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
SIZ (rem) = ns >= 0 ? dl : -dl;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_qr)
diff --git a/mpz/tdiv_qr_ui.c b/mpz/tdiv_qr_ui.c
index 361e5a4..ac59c18 100644
--- a/mpz/tdiv_qr_ui.c
+++ b/mpz/tdiv_qr_ui.c
@@ -20,7 +20,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -90,3 +89,4 @@ mpz_tdiv_qr_ui (mpz_ptr quot, mpz_ptr rem, mpz_srcptr dividend, unsigned long in
SIZ(quot) = ns >= 0 ? qn : -qn;
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_qr_ui)
diff --git a/mpz/tdiv_r.c b/mpz/tdiv_r.c
index 13de14b..0ea5951 100644
--- a/mpz/tdiv_r.c
+++ b/mpz/tdiv_r.c
@@ -18,9 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
void
mpz_tdiv_r (mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
@@ -85,3 +83,4 @@ mpz_tdiv_r (mpz_ptr rem, mpz_srcptr num, mpz_srcptr den)
SIZ (rem) = ns >= 0 ? dl : -dl;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_r)
diff --git a/mpz/tdiv_r_2exp.c b/mpz/tdiv_r_2exp.c
index 5ed9de8..46532c2 100644
--- a/mpz/tdiv_r_2exp.c
+++ b/mpz/tdiv_r_2exp.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -66,3 +65,4 @@ mpz_tdiv_r_2exp (mpz_ptr res, mpz_srcptr in, mp_bitcnt_t cnt)
MPN_COPY (PTR (res), PTR (in), limb_cnt);
SIZ (res) = SIZ (in) >= 0 ? res_size : -res_size;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_r_2exp)
diff --git a/mpz/tdiv_r_ui.c b/mpz/tdiv_r_ui.c
index a206811..567133b 100644
--- a/mpz/tdiv_r_ui.c
+++ b/mpz/tdiv_r_ui.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
@@ -86,3 +85,4 @@ mpz_tdiv_r_ui (mpz_ptr rem, mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_r_ui)
diff --git a/mpz/tdiv_ui.c b/mpz/tdiv_ui.c
index 6d834fc..306f1ba 100644
--- a/mpz/tdiv_ui.c
+++ b/mpz/tdiv_ui.c
@@ -18,9 +18,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
unsigned long int
mpz_tdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
@@ -72,3 +70,4 @@ mpz_tdiv_ui (mpz_srcptr dividend, unsigned long int divisor)
return rl;
}
+__GMP_PUBLIC_DEFINE (mpz_tdiv_ui)
diff --git a/mpz/tstbit.c b/mpz/tstbit.c
index 595a7b7..3517f4d 100644
--- a/mpz/tstbit.c
+++ b/mpz/tstbit.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -68,3 +67,4 @@ mpz_tstbit (mpz_srcptr u, mp_bitcnt_t bit_index) __GMP_NOTHROW
return (limb >> (bit_index % GMP_NUMB_BITS)) & 1;
}
+__GMP_PUBLIC_DEFINE (mpz_tstbit)
diff --git a/mpz/ui_pow_ui.c b/mpz/ui_pow_ui.c
index 4a0f7bd..c82ad1a 100644
--- a/mpz/ui_pow_ui.c
+++ b/mpz/ui_pow_ui.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -46,3 +45,4 @@ mpz_ui_pow_ui (mpz_ptr r, unsigned long b, unsigned long e)
#endif
}
}
+__GMP_PUBLIC_DEFINE (mpz_ui_pow_ui)
diff --git a/mpz/ui_sub.c b/mpz/ui_sub.c
index 76d4b82..3402aee 100644
--- a/mpz/ui_sub.c
+++ b/mpz/ui_sub.c
@@ -17,7 +17,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -83,3 +82,4 @@ mpz_ui_sub (mpz_ptr w, unsigned long int uval, mpz_srcptr v)
SIZ(w) = wn;
}
+__GMP_PUBLIC_DEFINE (mpz_ui_sub)
diff --git a/mpz/urandomb.c b/mpz/urandomb.c
index 00b6f2e..ab43f95 100644
--- a/mpz/urandomb.c
+++ b/mpz/urandomb.c
@@ -19,7 +19,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -35,3 +34,4 @@ mpz_urandomb (mpz_ptr rop, gmp_randstate_t rstate, mp_bitcnt_t nbits)
MPN_NORMALIZE (rp, size);
SIZ (rop) = size;
}
+__GMP_PUBLIC_DEFINE (mpz_urandomb)
diff --git a/mpz/urandomm.c b/mpz/urandomm.c
index 6bf7460..63afe4e 100644
--- a/mpz/urandomm.c
+++ b/mpz/urandomm.c
@@ -19,9 +19,7 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h" /* for count_leading_zeros */
#define MAX_URANDOMM_ITER 80
@@ -92,3 +90,4 @@ mpz_urandomm (mpz_ptr rop, gmp_randstate_t rstate, mpz_srcptr n)
SIZ (rop) = size;
TMP_FREE;
}
+__GMP_PUBLIC_DEFINE (mpz_urandomm)
diff --git a/mpz/xor.c b/mpz/xor.c
index 66ff1c0..c383ba8 100644
--- a/mpz/xor.c
+++ b/mpz/xor.c
@@ -18,7 +18,6 @@ License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -181,3 +180,4 @@ mpz_xor (mpz_ptr res, mpz_srcptr op1, mpz_srcptr op2)
TMP_FREE;
}
}
+__GMP_PUBLIC_DEFINE (mpz_xor)
--
1.8.1.2
More information about the gmp-devel
mailing list