Skip to content

Commit

Permalink
Fix function overload resolution. (#1667)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim authored Dec 12, 2024
1 parent ca70076 commit 6a6428e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/WFKafkaClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void KafkaClientTask::kafka_rebalance_callback(__WFKafkaTask *task)
snprintf(name, 64, "%p.cgroup", member);
member->mutex.unlock();

WFTaskFactory::signal_by_name(name, NULL, max);
WFTaskFactory::signal_by_name(name, (void *)NULL, max);
}
else
{
Expand Down
29 changes: 29 additions & 0 deletions src/factory/WFTaskFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <time.h>
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include <functional>
#include <openssl/ssl.h>
Expand Down Expand Up @@ -421,6 +423,33 @@ class WFTaskFactory
task->sub_series()->set_last_task(last);
return task;
}

public:
/* The following functions are for overload resolution only. */

static int send_by_name(const std::string& mailbox_name, intptr_t msg,
size_t max)
{
return WFTaskFactory::send_by_name(mailbox_name, (void *)msg, max);
}

static int send_by_name(const std::string& mailbox_name, std::nullptr_t msg,
size_t max)
{
return WFTaskFactory::send_by_name(mailbox_name, (void *)0, max);
}

static int signal_by_name(const std::string& cond_name, intptr_t msg,
size_t max)
{
return WFTaskFactory::signal_by_name(cond_name, (void *)msg, max);
}

static int signal_by_name(const std::string& cond_name, std::nullptr_t msg,
size_t max)
{
return WFTaskFactory::signal_by_name(cond_name, (void *)0, max);
}
};

template<class REQ, class RESP>
Expand Down
1 change: 1 addition & 0 deletions src/factory/WFTaskFactory.inl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <errno.h>
#include <time.h>
#include <netdb.h>
#include <stddef.h>
#include <stdio.h>
#include <string>
#include <functional>
Expand Down

0 comments on commit 6a6428e

Please sign in to comment.