/* Include file for internal GNU MP types and definitions.
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991-2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library; see the file COPYING.LIB. If not, see
+<http://www.gnu.org/licenses/>. */
/* When using gcc, make sure to use its builtin alloca. */
#if ! defined (alloca) && defined (__GNUC__)
#endif
#endif
-#if ! defined (HAVE_ALLOCA) || USE_STACK_ALLOC
+#if (! defined (alloca) && ! defined (HAVE_ALLOCA)) \
+ || defined (USE_STACK_ALLOC)
#include "stack-alloc.h"
#else
#define TMP_DECL(m)
#define inline /* Empty */
#endif
-#define ABS(x) (x >= 0 ? x : -x)
-#ifndef MIN
-#define MIN(l,o) ((l) < (o) ? (l) : (o))
-#endif
-#ifndef MAX
-#define MAX(h,i) ((h) > (i) ? (h) : (i))
-#endif
+/* Get MAX/MIN macros. */
+#include <sys/param.h>
/* Field access macros. */
#define SIZ(x) ((x)->_mp_size)
-#define ABSIZ(x) ABS (SIZ (x))
#define PTR(x) ((x)->_mp_d)
#define EXP(x) ((x)->_mp_exp)
#define PREC(x) ((x)->_mp_prec)
has to be set. Put the quotient in Q and the remainder in R. */
#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
do { \
- mp_limb_t _q, _ql, _r; \
+ mp_limb_t _ql __attribute__ ((unused)); \
+ mp_limb_t _q, _r; \
mp_limb_t _xh, _xl; \
umul_ppmm (_q, _ql, (nh), (di)); \
_q += (nh); /* DI is 2**BITS_PER_MP_LIMB too small */\
(r) = _r; \
(q) = _q; \
} while (0)
-/* Like udiv_qrnnd_preinv, but for for any value D. DNORM is D shifted left
+/* Like udiv_qrnnd_preinv, but for any value D. DNORM is D shifted left
so that its most significant bit is set. LGUP is ceil(log2(D)). */
#define udiv_qrnnd_preinv2gen(q, r, nh, nl, d, di, dnorm, lgup) \
do { \
/* Prototypes for internal mpn calls. */
extern void impn_mul_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
- mp_srcptr vp, mp_size_t size));
+ mp_srcptr vp, mp_size_t size))
+ attribute_hidden;
extern void impn_mul_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_srcptr vp,
- mp_size_t size, mp_ptr tspace));
+ mp_size_t size, mp_ptr tspace))
+ attribute_hidden;
extern void impn_sqr_n_basecase _PROTO ((mp_ptr prodp, mp_srcptr up,
- mp_size_t size));
+ mp_size_t size))
+ attribute_hidden;
extern void impn_sqr_n _PROTO ((mp_ptr prodp, mp_srcptr up, mp_size_t size,
- mp_ptr tspace));
+ mp_ptr tspace))
+ attribute_hidden;