1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

security/kleopatra: Fix build against libc++18

libc++ 18 by default removes unique() in 'std::shared_ptr' (in <memory>), as
a follow-up to this resolution:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0521r0.html

An alternative would be to get it back by defining
_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUE before including the libc++
headers, but trying to fight the standard may not be a wise move going forward,
especially if/as other C++ libraries follow suit.

Upstream MR (approved) is at
https://invent.kde.org/pim/kleopatra/-/merge_requests/205.

PR:             279139
Approved by:    kde (maintainer)
Approved by:    jrm (ports)
Approved by:    markj (mentor)
This commit is contained in:
Olivier Certner 2024-05-22 21:08:41 +02:00
parent bf07b314c2
commit 97eecf838a
No known key found for this signature in database
GPG Key ID: 8CA13040971E2627
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,14 @@
Submitted upstream: https://invent.kde.org/pim/kleopatra/-/merge_requests/205.
To remove when updating to next release.
--- src/crypto/recipient.cpp.orig 2024-02-11 04:00:57 UTC
+++ src/crypto/recipient.cpp
@@ -85,7 +85,7 @@ void Recipient::detach()
void Recipient::detach()
{
- if (d && !d.unique()) {
+ if (d && d.use_count() != 1) {
d.reset(new Private(*d));
}
}

View File

@ -0,0 +1,14 @@
Submitted upstream: https://invent.kde.org/pim/kleopatra/-/merge_requests/205.
To remove when updating to next release.
--- src/crypto/sender.cpp.orig 2024-02-11 04:00:57 UTC
+++ src/crypto/sender.cpp
@@ -91,7 +91,7 @@ void Sender::detach()
void Sender::detach()
{
- if (d && !d.unique()) {
+ if (d && d.use_count() != 1) {
d.reset(new Private(*d));
}
}