From 28fd6f320bbc8fededc8e4803989858c07967ba6 Mon Sep 17 00:00:00 2001 From: "Carlos J. Puga Medina" Date: Fri, 20 Jan 2017 19:38:56 +0000 Subject: dns/powerdns and dns/powerdns-recursor: unbreak build with clang 4.0 json11.cpp:153:24: error: invalid operands to binary expression ('nullptr_t' and 'nullptr_t') return m_value < static_cast *>(other)->m_value; ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ json11.cpp:209:5: note: in instantiation of member function 'json11::Value::less' requested here JsonNull() : Value(nullptr) {} ^ PR: 216071 Submitted by: cpm Reported by: jbeich Reviewed by: jbeich Approved by: Ralf van der Enden (maintainer) Obtained from: upstream MFH: 2017Q1 (blanket) --- dns/powerdns/files/patch-ext_json11_json11.cpp | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 dns/powerdns/files/patch-ext_json11_json11.cpp (limited to 'dns/powerdns/files/patch-ext_json11_json11.cpp') diff --git a/dns/powerdns/files/patch-ext_json11_json11.cpp b/dns/powerdns/files/patch-ext_json11_json11.cpp new file mode 100644 index 000000000000..65252fe28a63 --- /dev/null +++ b/dns/powerdns/files/patch-ext_json11_json11.cpp @@ -0,0 +1,37 @@ +--- ext/json11/json11.cpp.orig 2017-01-18 18:06:37 UTC ++++ ext/json11/json11.cpp +@@ -37,11 +37,21 @@ using std::make_shared; + using std::initializer_list; + using std::move; + ++/* Helper for representing null - just a do-nothing struct, plus comparison ++ * operators so the helpers in JsonValue work. We can't use nullptr_t because ++ * it may not be orderable. ++*/ ++ ++struct NullStruct { ++ bool operator==(NullStruct) const { return true; } ++ bool operator<(NullStruct) const { return false; } ++}; ++ + /* * * * * * * * * * * * * * * * * * * * + * Serialization + */ + +-static void dump(std::nullptr_t, string &out) { ++static void dump(NullStruct, string &out) { + out += "null"; + } + +@@ -204,9 +214,9 @@ public: + explicit JsonObject(Json::object &&value) : Value(move(value)) {} + }; + +-class JsonNull final : public Value { ++class JsonNull final : public Value { + public: +- JsonNull() : Value(nullptr) {} ++ JsonNull() : Value({}) {} + }; + + /* * * * * * * * * * * * * * * * * * * * -- cgit v1.2.3