From c45be27cd3ca3f1b6426f59791b9bb30acc56567 Mon Sep 17 00:00:00 2001 From: Marco Bodrato Date: Thu, 20 Aug 2015 08:16:32 +0200 Subject: gmp-impl.h: New MPQ_{SRC,}PTR_SWAP macro --- gmp-impl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gmp-impl.h') 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. */ -- cgit v1.2.1