diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-07-10 01:31:13 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-07-10 01:31:13 +0200 |
commit | aa5b9117519b6c4e8ca09cb44dfb664c504ac714 (patch) | |
tree | 87b54d25fa610a99341eb55fdf9182cf97ddaff5 /gmp-impl.h | |
parent | 4b434fafee05e595204836dc792805e9274694d7 (diff) | |
download | gmp-aa5b9117519b6c4e8ca09cb44dfb664c504ac714.tar.gz |
* errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
__gmp_sqrt_of_negative): New functions.
* gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
This should reduce code size in functions raising exceptions, and stop
them having to reference global variables thus perhaps avoiding GOT
setups for PIC etc.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 1f045d9c3..e065cee1d 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -1691,9 +1691,12 @@ int __gmp_extract_double _PROTO ((mp_ptr, double)); extern int __gmp_junk; extern const int __gmp_0; -#define GMP_ERROR(code) (gmp_errno |= (code), __gmp_junk = 10/__gmp_0) -#define DIVIDE_BY_ZERO GMP_ERROR(GMP_ERROR_DIVISION_BY_ZERO) -#define SQRT_OF_NEGATIVE GMP_ERROR(GMP_ERROR_SQRT_OF_NEGATIVE) +void __gmp_exception _PROTO ((int)) ATTRIBUTE_NORETURN; +void __gmp_divide_by_zero _PROTO ((void)) ATTRIBUTE_NORETURN; +void __gmp_sqrt_of_negative _PROTO ((void)) ATTRIBUTE_NORETURN; +#define GMP_ERROR(code) __gmp_exception (code) +#define DIVIDE_BY_ZERO __gmp_divide_by_zero () +#define SQRT_OF_NEGATIVE __gmp_sqrt_of_negative () #if defined _LONG_LONG_LIMB #if __GMP_HAVE_TOKEN_PASTE |