]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/gmp-impl.h
Add a test for longjmp from user context
[thirdparty/glibc.git] / stdlib / gmp-impl.h
index f6454ee2d076f9bfdcd9f27d7822c1b8a1d7e5b0..1c32bd26b1a391a339a0e33cbe6d44fc6f73f148 100644 (file)
@@ -1,6 +1,6 @@
 /* Include file for internal GNU MP types and definitions.
 
-Copyright (C) 1991, 1993, 1994, 1995, 1996, 2011 Free Software Foundation, Inc.
+Copyright (C) 1991-2023 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -16,7 +16,7 @@ License for more details.
 
 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/>.  */
+<https://www.gnu.org/licenses/>.  */
 
 /* When using gcc, make sure to use its builtin alloca.  */
 #if ! defined (alloca) && defined (__GNUC__)
@@ -47,7 +47,8 @@ along with the GNU MP Library; see the file COPYING.LIB.  If not, see
 #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)
@@ -64,17 +65,11 @@ along with the GNU MP Library; see the file COPYING.LIB.  If not, see
 #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)
@@ -216,7 +211,8 @@ extern mp_size_t __gmp_default_fp_limb_precision;
    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 */\
@@ -312,60 +308,14 @@ typedef unsigned int UHWtype;
 
 /* 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));
-
-
-
-#ifndef IEEE_DOUBLE_BIG_ENDIAN
-#define IEEE_DOUBLE_BIG_ENDIAN 1
-#endif
-
-#ifndef IEEE_DOUBLE_MIXED_ENDIAN
-#define IEEE_DOUBLE_MIXED_ENDIAN 0
-#endif
-
-#if IEEE_DOUBLE_MIXED_ENDIAN
-union ieee_double_extract
-{
-  struct
-    {
-      unsigned int manh:20;
-      unsigned int exp:11;
-      unsigned int sig:1;
-      unsigned int manl:32;
-    } s;
-  double d;
-};
-#else
-#if IEEE_DOUBLE_BIG_ENDIAN
-union ieee_double_extract
-{
-  struct
-    {
-      unsigned int sig:1;
-      unsigned int exp:11;
-      unsigned int manh:20;
-      unsigned int manl:32;
-    } s;
-  double d;
-};
-#else
-union ieee_double_extract
-{
-  struct
-    {
-      unsigned int manl:32;
-      unsigned int manh:20;
-      unsigned int exp:11;
-      unsigned int sig:1;
-    } s;
-  double d;
-};
-#endif
-#endif
+                               mp_ptr tspace))
+     attribute_hidden;