From 588303b78def99b851284d46f155c9f8fae67329 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Aug 2016 18:06:07 +0200 Subject: [PATCH] lib/nfs/Manager: add Compare(ManagedConnection, ManagedConnection) Required for Boost 1.61, which uses that overload in a BOOST_ASSERT(). --- NEWS | 1 + src/lib/nfs/Manager.cxx | 12 ++++++++++++ src/lib/nfs/Manager.hxx | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index d47e97a48..e56ccc394 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ ver 0.19.18 (not yet released) - sidplay: allow building with libsidplayfp instead of libsidplay2 * output - shout: recognize setting "encoder" instead of "encoding" +* fix build failure with Boost 1.61 * require gcc 4.7 or newer ver 0.19.17 (2016/07/09) diff --git a/src/lib/nfs/Manager.cxx b/src/lib/nfs/Manager.cxx index 6d50cce18..2164b1d07 100644 --- a/src/lib/nfs/Manager.cxx +++ b/src/lib/nfs/Manager.cxx @@ -59,6 +59,18 @@ NfsManager::Compare::operator()(const ManagedConnection &a, return result < 0; } +inline bool +NfsManager::Compare::operator()(const ManagedConnection &a, + const ManagedConnection &b) const +{ + int result = strcmp(a.GetServer(), b.GetServer()); + if (result != 0) + return result < 0; + + result = strcmp(a.GetExportName(), b.GetExportName()); + return result < 0; +} + NfsManager::~NfsManager() { assert(GetEventLoop().IsInside()); diff --git a/src/lib/nfs/Manager.hxx b/src/lib/nfs/Manager.hxx index 130c81aca..80acbdfc9 100644 --- a/src/lib/nfs/Manager.hxx +++ b/src/lib/nfs/Manager.hxx @@ -64,6 +64,10 @@ class NfsManager final : IdleMonitor { gcc_pure bool operator()(const ManagedConnection &a, const LookupKey b) const; + + gcc_pure + bool operator()(const ManagedConnection &a, + const ManagedConnection &b) const; }; /**