From: Otto Moerbeek Date: Mon, 28 Mar 2022 15:07:27 +0000 (+0200) Subject: Move remaining boost:function to std::function X-Git-Tag: rec-4.7.0-beta1~25^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4319769c43881eebebe566dfed7fa0541a4fff0;p=thirdparty%2Fpdns.git Move remaining boost:function to std::function --- diff --git a/pdns/mtasker.hh b/pdns/mtasker.hh index 62bf590987..c1806a8241 100644 --- a/pdns/mtasker.hh +++ b/pdns/mtasker.hh @@ -32,7 +32,7 @@ #include "misc.hh" #include "mtasker_context.hh" #include -#include + using namespace ::boost::multi_index; // #define MTASKERTIMING 1 @@ -56,7 +56,7 @@ private: struct ThreadInfo { std::shared_ptr context; - boost::function start; + std::function start; char* startOfStack; char* highestStackSeen; #ifdef MTASKERTIMING diff --git a/pdns/mtasker_context.hh b/pdns/mtasker_context.hh index 3c1a95b143..dc98686a01 100644 --- a/pdns/mtasker_context.hh +++ b/pdns/mtasker_context.hh @@ -21,7 +21,6 @@ */ #pragma once #include "lazy_allocator.hh" -#include #include #include @@ -46,7 +45,7 @@ pdns_swapcontext void pdns_makecontext -(pdns_ucontext_t& ctx, boost::function& start); +(pdns_ucontext_t& ctx, std::function& start); #ifdef HAVE_FIBER_SANITIZER #include diff --git a/pdns/mtasker_fcontext.cc b/pdns/mtasker_fcontext.cc index 72627a7e5c..b4aa3a44b3 100644 --- a/pdns/mtasker_fcontext.cc +++ b/pdns/mtasker_fcontext.cc @@ -92,7 +92,7 @@ struct args_t { fcontext_t prev_ctx = nullptr; #endif pdns_ucontext_t* self = nullptr; - boost::function* work = nullptr; + std::function* work = nullptr; }; extern "C" { @@ -212,7 +212,7 @@ pdns_swapcontext void pdns_makecontext -(pdns_ucontext_t& ctx, boost::function& start) { +(pdns_ucontext_t& ctx, std::function& start) { assert (ctx.uc_link); assert (ctx.uc_stack.size() >= 8192); assert (!ctx.uc_mcontext); diff --git a/pdns/mtasker_ucontext.cc b/pdns/mtasker_ucontext.cc index 2cecc97f4a..83d326d4c3 100644 --- a/pdns/mtasker_ucontext.cc +++ b/pdns/mtasker_ucontext.cc @@ -83,7 +83,7 @@ threadWrapper (int const ctx0, int const ctx1, int const fun0, int const fun1) { notifyStackSwitchDone(); auto ctx = joinPtr(ctx0, ctx1); try { - auto start = std::move(*joinPtr>(fun0, fun1)); + auto start = std::move(*joinPtr>(fun0, fun1)); start(); } catch (...) { ctx->exception = std::current_exception(); @@ -123,7 +123,7 @@ pdns_swapcontext void pdns_makecontext -(pdns_ucontext_t& ctx, boost::function& start) { +(pdns_ucontext_t& ctx, std::function& start) { assert (ctx.uc_link); assert (ctx.uc_stack.size()); diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 65c25bdffa..ab0e978291 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -1105,7 +1105,7 @@ void broadcastFunction(const pipefunc_t& func) } template -void* voider(const boost::function& func) +void* voider(const std::function& func) { return func(); } diff --git a/pdns/recursordist/rec-main.hh b/pdns/recursordist/rec-main.hh index 89eb0a93d9..98eb57023e 100644 --- a/pdns/recursordist/rec-main.hh +++ b/pdns/recursordist/rec-main.hh @@ -254,7 +254,7 @@ extern std::set g_avoidUdpSourcePorts; #endif /* without reuseport, all listeners share the same sockets */ -typedef vector>> deferredAdd_t; +typedef vector>> deferredAdd_t; extern deferredAdd_t g_deferredAdds; typedef map tcpClientCounts_t; diff --git a/pdns/statbag.hh b/pdns/statbag.hh index acdc383230..ee794c1a9d 100644 --- a/pdns/statbag.hh +++ b/pdns/statbag.hh @@ -73,7 +73,7 @@ class StatBag map > > d_rings; map > > d_comboRings; map > > > d_dnsnameqtyperings; - typedef boost::function func_t; + typedef std::function func_t; typedef map funcstats_t; funcstats_t d_funcstats; bool d_doRings; diff --git a/pdns/webserver.hh b/pdns/webserver.hh index d8707e0914..16e6df9fbc 100644 --- a/pdns/webserver.hh +++ b/pdns/webserver.hh @@ -195,7 +195,7 @@ public: void serveConnection(const std::shared_ptr& client) const; void handleRequest(HttpRequest& request, HttpResponse& resp) const; - typedef boost::function HandlerFunction; + typedef std::function HandlerFunction; void registerApiHandler(const string& url, const HandlerFunction& handler, bool allowPassword=false); void registerWebHandler(const string& url, const HandlerFunction& handler); diff --git a/pdns/ws-auth.hh b/pdns/ws-auth.hh index 9807c2f5e3..2bbb3f3eb2 100644 --- a/pdns/ws-auth.hh +++ b/pdns/ws-auth.hh @@ -78,7 +78,7 @@ private: void indexfunction(HttpRequest* req, HttpResponse* resp); void cssfunction(HttpRequest* req, HttpResponse* resp); void jsonstat(HttpRequest* req, HttpResponse* resp); - void registerApiHandler(const string& url, boost::function handler); + void registerApiHandler(const string& url, std::function handler); void printvars(ostringstream &ret); void printargs(ostringstream &ret); void webThread(); diff --git a/pdns/ws-recursor.hh b/pdns/ws-recursor.hh index 0a1a7fde3a..1389b43f04 100644 --- a/pdns/ws-recursor.hh +++ b/pdns/ws-recursor.hh @@ -39,7 +39,7 @@ public: friend void AsyncServerNewConnectionMT(void* p); - typedef boost::function)> newconnectioncb_t; + typedef std::function)> newconnectioncb_t; void asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback); private: diff --git a/pdns/zone2ldap.cc b/pdns/zone2ldap.cc index 38c3b7e728..f0c9059778 100644 --- a/pdns/zone2ldap.cc +++ b/pdns/zone2ldap.cc @@ -33,7 +33,6 @@ #include "arguments.hh" #include "bindparserclasses.hh" #include "statbag.hh" -#include #include "dnsrecords.hh" #include "misc.hh" #include "dns.hh" @@ -274,7 +273,7 @@ int main( int argc, char* argv[] ) g_basedn = args["basedn"]; g_dnsttl = args.mustDo( "dnsttl" ); - typedef boost::function callback_t; + typedef std::function callback_t; callback_t callback = callback_simple; if( args["layout"] == "tree" ) {