summaryrefslogtreecommitdiff
path: root/gmp-impl.h
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2015-08-20 08:16:32 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2015-08-20 08:16:32 +0200
commitc45be27cd3ca3f1b6426f59791b9bb30acc56567 (patch)
treee8c0b3cd75c488265ca7bd593e6f0412084fe3d8 /gmp-impl.h
parent2b07cd256169012e05de2518e76410452ebbc81b (diff)
downloadgmp-c45be27cd3ca3f1b6426f59791b9bb30acc56567.tar.gz
gmp-impl.h: New MPQ_{SRC,}PTR_SWAP macro
Diffstat (limited to 'gmp-impl.h')
-rw-r--r--gmp-impl.h13
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. */