From: Malte Forkel <malte.forkel@berlin.de>
To: crossgcc@sourceware.org
Subject: [Patch] Avoid redefinition in PPL
Date: Sun, 16 Mar 2014 20:22:00 -0000 [thread overview]
Message-ID: <532607F3.7040901@berlin.de> (raw)
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
reply other threads:[~2014-03-16 20:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=532607F3.7040901@berlin.de \
--to=malte.forkel@berlin.de \
--cc=crossgcc@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).