mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-08 02:15:08 +00:00
4fa5971018
* patch-misc.h This fixes a warning triggered by testing an unsigned parameter against 0. The patch solves this by creating a different template for signed case. * patch-nbtheory.cpp This is a workaround for a bug with the current version of libc++ shipped with FreeBSD 9.x, which causes an infinite loop when generating RSA key, possibly also other operations. PR: ports/178827 Submitted by: Michael Gmelin <freebsd grem de>
22 lines
741 B
C++
22 lines
741 B
C++
--- nbtheory.cpp.orig 2013-05-22 00:16:26.761193859 +0000
|
|
+++ nbtheory.cpp 2013-05-22 00:15:29.401256454 +0000
|
|
@@ -307,7 +307,18 @@
|
|
|
|
bool PrimeSieve::NextCandidate(Integer &c)
|
|
{
|
|
+#if defined(__clang__) && defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 1101
|
|
+ // Workaround for a bug in libc++ in std::find on std::vector<bool>
|
|
+ std::vector<bool>::iterator pos = m_sieve.begin()+m_next;
|
|
+ for (std::vector<bool>::iterator end = m_sieve.end(); pos != end; ++pos)
|
|
+ {
|
|
+ if (*pos == false)
|
|
+ break;
|
|
+ }
|
|
+ bool safe = SafeConvert(pos - m_sieve.begin(), m_next);
|
|
+#else
|
|
bool safe = SafeConvert(std::find(m_sieve.begin()+m_next, m_sieve.end(), false) - m_sieve.begin(), m_next);
|
|
+#endif
|
|
assert(safe);
|
|
if (m_next == m_sieve.size())
|
|
{
|