diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-08-20 08:16:32 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-08-20 08:16:32 +0200 |
commit | c45be27cd3ca3f1b6426f59791b9bb30acc56567 (patch) | |
tree | e8c0b3cd75c488265ca7bd593e6f0412084fe3d8 /gmp-impl.h | |
parent | 2b07cd256169012e05de2518e76410452ebbc81b (diff) | |
download | gmp-c45be27cd3ca3f1b6426f59791b9bb30acc56567.tar.gz |
gmp-impl.h: New MPQ_{SRC,}PTR_SWAP macro
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 7f807337a..689c91886 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -677,6 +677,19 @@ __GMP_DECLSPEC void __gmp_tmp_debug_free (const char *, int, int, (y) = __mpz_srcptr_swap__tmp; \ } while (0) +#define MPQ_PTR_SWAP(x, y) \ + do { \ + mpq_ptr __mpq_ptr_swap__tmp = (x); \ + (x) = (y); \ + (y) = __mpq_ptr_swap__tmp; \ + } while (0) +#define MPQ_SRCPTR_SWAP(x, y) \ + do { \ + mpq_srcptr __mpq_srcptr_swap__tmp = (x); \ + (x) = (y); \ + (y) = __mpq_srcptr_swap__tmp; \ + } while (0) + /* Enhancement: __gmp_allocate_func could have "__attribute__ ((malloc))", but current gcc (3.0) doesn't seem to support that. */ |