Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / liblinphone / backport-cpp17.patch
blobd9eb75fa2768c03970bbb15d0cb40cf427327e4d
1 From 9ece6e77dcf6545c3b8104068302c6243e3a5e88 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?=
3 <mickael.turnel@belledonne-communications.com>
4 Date: Wed, 1 Mar 2023 09:14:53 +0100
5 Subject: [PATCH] Set c++ version 17 and fix compilation errors
7 Backported-by: Lorenz Brun <lorenz@brun.one>
9 ---
10 CMakeLists.txt | 2 +-
11 daemon/daemon.cc | 2 +-
12 libxsd/xsd/cxx/config.hxx | 2 +-
13 src/conference/session/streams-group.cpp | 10 +++++-----
14 4 files changed, 8 insertions(+), 8 deletions(-)
16 diff --git a/CMakeLists.txt b/CMakeLists.txt
17 index 475ff16a8..a771e4595 100644
18 --- a/CMakeLists.txt
19 +++ b/CMakeLists.txt
20 @@ -92,7 +92,7 @@ cmake_dependent_option(ENABLE_QRCODE "Enable QRCode support" YES "ENABLE_VIDEO"
21 # * DISABLE_BC_PACKAGE_SEARCH: skip find_package() for every BC package (bctoolbox, ortp, etc.)
22 # * DISABLE_SOCI_PACKAGE_SEARCH: skip find_package() for Soci.
24 -set(CMAKE_CXX_STANDARD 14)
25 +set(CMAKE_CXX_STANDARD 17)
26 set(CMAKE_CXX_EXTENSIONS NO)
28 if(NOT CMAKE_BUILD_TYPE)
29 diff --git a/daemon/daemon.cc b/daemon/daemon.cc
30 index 197fc22ef..fd09edb26 100644
31 --- a/daemon/daemon.cc
32 +++ b/daemon/daemon.cc
33 @@ -628,7 +628,7 @@ void Daemon::execCommand(const string &command) {
34 ist.get(argsbuf);
35 string args = argsbuf.str();
36 if (!args.empty() && (args[0] == ' ')) args.erase(0, 1);
37 - list<DaemonCommand*>::iterator it = find_if(mCommands.begin(), mCommands.end(), bind2nd(mem_fun(&DaemonCommand::matches), name));
38 + list<DaemonCommand*>::iterator it = find_if(mCommands.begin(), mCommands.end(), [&name](const DaemonCommand *dc) { return dc->matches(name); });
39 if (it != mCommands.end()) {
40 ms_mutex_lock(&mMutex);
41 (*it)->exec(this, args);
42 diff --git a/libxsd/xsd/cxx/config.hxx b/libxsd/xsd/cxx/config.hxx
43 index 076b107f5..385841731 100644
44 --- a/libxsd/xsd/cxx/config.hxx
45 +++ b/libxsd/xsd/cxx/config.hxx
46 @@ -19,7 +19,7 @@
47 # endif
48 #else
49 # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
50 -# ifdef __GNUC__
51 +# if defined(__GNUC__) && !defined(__clang__)
52 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4
53 # define XSD_CXX11_NULLPTR
54 # endif
55 diff --git a/src/conference/session/streams-group.cpp b/src/conference/session/streams-group.cpp
56 index bff739dda..84277a6b7 100644
57 --- a/src/conference/session/streams-group.cpp
58 +++ b/src/conference/session/streams-group.cpp
59 @@ -447,11 +447,11 @@ float StreamsGroup::computeOverallQuality(_functor func){
62 float StreamsGroup::getAverageQuality(){
63 - return computeOverallQuality(mem_fun(&Stream::getAverageQuality));
64 + return computeOverallQuality(mem_fn(&Stream::getAverageQuality));
67 float StreamsGroup::getCurrentQuality(){
68 - return computeOverallQuality(mem_fun(&Stream::getCurrentQuality));
69 + return computeOverallQuality(mem_fn(&Stream::getCurrentQuality));
72 int StreamsGroup::getAvpfRrInterval()const{
73 @@ -481,11 +481,11 @@ bool StreamsGroup::avpfEnabled() const{
76 void StreamsGroup::refreshSockets(){
77 - forEach<Stream>(mem_fun(&Stream::refreshSockets));
78 + forEach<Stream>(mem_fn(&Stream::refreshSockets));
81 void StreamsGroup::computeAndReportBandwidth(){
82 - forEach<Stream>(mem_fun(&Stream::updateBandwidthReports));
83 + forEach<Stream>(mem_fn(&Stream::updateBandwidthReports));
85 if (!bctbx_log_level_enabled(BCTBX_LOG_DOMAIN, BCTBX_LOG_MESSAGE)) return;
87 @@ -540,7 +540,7 @@ void StreamsGroup::finish(){
88 mIceService->finish(); // finish ICE first, as it has actions on the streams.
89 for (auto & ss : mSharedServices) ss.second->checkDestroy();
90 mSharedServices.clear();
91 - forEach<Stream>(mem_fun(&Stream::finish));
92 + forEach<Stream>(mem_fn(&Stream::finish));
93 mFinished = true;
96 --
97 2.41.0