pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/powerdns Fix build with clang: ISO C++ says nullpt...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9831ccbbfd13
branches:  trunk
changeset: 360151:9831ccbbfd13
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Mar 24 15:14:14 2017 +0000

description:
Fix build with clang: ISO C++ says nullptr has no relation operators
defined.

diffstat:

 net/powerdns/distinfo                            |   3 +-
 net/powerdns/patches/patch-ext_json11_json11.cpp |  30 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 7341ac816319 -r 9831ccbbfd13 net/powerdns/distinfo
--- a/net/powerdns/distinfo     Fri Mar 24 15:12:30 2017 +0000
+++ b/net/powerdns/distinfo     Fri Mar 24 15:14:14 2017 +0000
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.22 2017/03/09 13:32:54 fhajny Exp $
+$NetBSD: distinfo,v 1.23 2017/03/24 15:14:14 joerg Exp $
 
 SHA1 (pdns-4.0.3.tar.bz2) = de3562f135d31c6ccf9363f587bb59a5f65d1d91
 RMD160 (pdns-4.0.3.tar.bz2) = 5befc3a60dbbb14386f3557c7c419ee4b92b2438
 SHA512 (pdns-4.0.3.tar.bz2) = 58d33ac6cf457a916bae6abd8d2dc17f76fbcd1bd9e649948584dd669f5596b43e3e4d91841700ea1ea2cd1ac102749e503cd9075273540f33a2321e20d8bfc2
 Size (pdns-4.0.3.tar.bz2) = 1312299 bytes
 SHA1 (patch-configure) = 675ce8b372819a746ec9d4fbff6bea30ecd86734
+SHA1 (patch-ext_json11_json11.cpp) = a8ffe67156a836841aef8a6bba134a82283f381e
 SHA1 (patch-pdns_dns.hh) = 626eb4e29b7fcd82fbe056036c157c1e85fa49ca
 SHA1 (patch-pdns_dnsscope.cc) = b289b750686b25041c3e291fb0d3d562beb36eaf
 SHA1 (patch-pdns_iputils.hh) = 48df687a1e5116238aa4f04ff89cbdc2b4b4dfc3
diff -r 7341ac816319 -r 9831ccbbfd13 net/powerdns/patches/patch-ext_json11_json11.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/powerdns/patches/patch-ext_json11_json11.cpp  Fri Mar 24 15:14:14 2017 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-ext_json11_json11.cpp,v 1.1 2017/03/24 15:14:14 joerg Exp $
+
+Clang rejects ordering relations for nullptr, so introduce a template
+indirection.
+
+--- ext/json11/json11.cpp.orig 2017-03-24 11:51:24.440658307 +0000
++++ ext/json11/json11.cpp
+@@ -132,6 +133,13 @@ void Json::dump(string &out) const {
+  * Value wrappers
+  */
+ 
++template <typename T> bool json11_less(T a, T b) {
++  return a < b;
++}
++template <> bool json11_less(const std::nullptr_t a, const std::nullptr_t b) {
++  return false;
++}
++
+ template <Json::Type tag, typename T>
+ class Value : public JsonValue {
+ protected:
+@@ -150,7 +158,7 @@ protected:
+         return m_value == static_cast<const Value<tag, T> *>(other)->m_value;
+     }
+     bool less(const JsonValue * other) const override {
+-        return m_value < static_cast<const Value<tag, T> *>(other)->m_value;
++        return json11_less(m_value, static_cast<const Value<tag, T> *>(other)->m_value);
+     }
+ 
+     const T m_value;



Home | Main Index | Thread Index | Old Index