* [Patch] Avoid redefinition in PPL
@ 2014-03-16 20:22 Malte Forkel
0 siblings, 0 replies; only message in thread
From: Malte Forkel @ 2014-03-16 20:22 UTC (permalink / raw)
To: crossgcc
Hello,
While building a toolchain with crosstool-NG 0.19.0, I ran into a
conflict between GMP 5.1.1 and PPL 0.11.2:
.build/src/ppl-0.11.2/src/mp_std_bits.defs.hh:48:7: error:
redefinition of 'class std::numeric_limits<__gmp_expr<__mpz_struct [1],
__mpz_struct [1]> >'
I backported the attached patch from the PPL mailing list [1] to PPL
0.11.2 and successfully used it in crosstool-ng as
ct-ng.1.19.0/patches/ppl/0.11.2/400-fix-redefinition-numeric-limits.patch.
Please let me know if this is not the proper way to suggest a patch to
crosstool-ng.
Thanks,
Malte
[1] http://www.cs.unipr.it/pipermail/ppl-devel/2012-December/018574.html
diff --git a/src/mp_std_bits.cc b/src/mp_std_bits.cc
--- a/src/mp_std_bits.cc
+++ b/src/mp_std_bits.cc
@@ -26,6 +26,9 @@
#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>::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)
diff --git a/src/mp_std_bits.defs.hh b/src/mp_std_bits.defs.hh
--- a/src/mp_std_bits.defs.hh
+++ b/src/mp_std_bits.defs.hh
@@ -39,6 +39,9 @@
#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 @@
} // 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)
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-03-16 20:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-16 20:22 [Patch] Avoid redefinition in PPL Malte Forkel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).