pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/dnsdist Don't try to order null pointers.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ec0318e80439
branches:  trunk
changeset: 362708:ec0318e80439
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon May 22 23:41:22 2017 +0000

description:
Don't try to order null pointers.

diffstat:

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

diffs (50 lines):

diff -r dfb2b116f322 -r ec0318e80439 net/dnsdist/distinfo
--- a/net/dnsdist/distinfo      Mon May 22 23:40:42 2017 +0000
+++ b/net/dnsdist/distinfo      Mon May 22 23:41:22 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2017/03/31 20:49:51 fhajny Exp $
+$NetBSD: distinfo,v 1.2 2017/05/22 23:41:22 joerg Exp $
 
 SHA1 (dnsdist-1.1.0.tar.bz2) = 9b6372fc5f606ee83dac465e1dc9c824242f5905
 RMD160 (dnsdist-1.1.0.tar.bz2) = 7724641b2be1c3611dd0b2c685cf6e8b7a365e67
@@ -7,5 +7,6 @@
 SHA1 (patch-dns.hh) = 13834e3d9f48b3095ce4912540c7d0d275c3a3a3
 SHA1 (patch-dnsdist-console.cc) = 51fee0e89b648e0f9c2e6c0d9a6859ef2991a1b7
 SHA1 (patch-dnsdist.cc) = 2b2bf569c134019dd8a5d4f3df104fdd16a47a31
+SHA1 (patch-ext_json11_json11.cpp) = 9fb12578d80103b8b92e984a483cbda98fd83db8
 SHA1 (patch-iputils.hh) = 666fe81cc651b2c7e85164b8246283e301bcce1a
 SHA1 (patch-qtype.hh) = 4551be1e303a31d34030c363849398923f5ff987
diff -r dfb2b116f322 -r ec0318e80439 net/dnsdist/patches/patch-ext_json11_json11.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/dnsdist/patches/patch-ext_json11_json11.cpp   Mon May 22 23:41:22 2017 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-ext_json11_json11.cpp,v 1.1 2017/05/22 23:41:22 joerg Exp $
+
+Clang rejects ordering relations for nullptr, so introduce a template
+indirection.
+
+--- ext/json11/json11.cpp.orig 2016-12-29 12:45:46.000000000 +0000
++++ ext/json11/json11.cpp
+@@ -132,6 +132,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 +157,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