summaryrefslogtreecommitdiff
path: root/patches/ppl/0.11.2/400-fix-build-with-gmp-5.1.patch
blob: 89d7a74ed4694db906d22287eb195b3815f1705a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 9f843aecc23981aec6ed1eaa8be06e6786a47f0d Mon Sep 17 00:00:00 2001
From: Roberto Bagnara <bagnara@cs.unipr.it>
Date: Wed, 19 Dec 2012 08:42:19 +0100
Subject: [PATCH] GMP version 5.1.0 (and, presumably, later versions) defines
 std::numeric_limits.

---
 src/mp_std_bits.cc      |    6 ++++++
 src/mp_std_bits.defs.hh |    6 ++++++
 2 files changed, 12 insertions(+)

--- a/src/mp_std_bits.cc
+++ b/src/mp_std_bits.cc
@@ -26,6 +26,9 @@ site: http://www.cs.unipr.it/ppl/ . */
 #include <ppl-config.h>
 #include "mp_std_bits.defs.hh"
 
+#if __GNU_MP_VERSION < 5 \
+  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
+
 const bool std::numeric_limits<mpz_class>::is_specialized;
 const int std::numeric_limits<mpz_class>::digits;
 const int std::numeric_limits<mpz_class>::digits10;
@@ -71,3 +74,6 @@ const bool std::numeric_limits<mpq_class
 const bool std::numeric_limits<mpq_class>::traps;
 const bool std::numeric_limits<mpq_class>::tininess_before;
 const std::float_round_style std::numeric_limits<mpq_class>::round_style;
+
+#endif // __GNU_MP_VERSION < 5
+       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
--- a/src/mp_std_bits.defs.hh
+++ b/src/mp_std_bits.defs.hh
@@ -39,6 +39,9 @@ void swap(mpz_class& x, mpz_class& y);
 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
 void swap(mpq_class& x, mpq_class& y);
 
+#if __GNU_MP_VERSION < 5 \
+  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
+
 namespace std {
 
 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
@@ -165,6 +168,9 @@ public:
 
 } // namespace std
 
+#endif // __GNU_MP_VERSION < 5
+       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
+
 #include "mp_std_bits.inlines.hh"
 
 #endif // !defined(PPL_mp_std_bits_defs_hh)