Skip to content

Commit

Permalink
Fix function overload resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim committed Dec 12, 2024
1 parent fe5197a commit 61cc990
Show file tree
Hide file tree
Showing 3 changed files with 43 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
41 changes: 41 additions & 0 deletions src/factory/WFTaskFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,47 @@ 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);
}

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

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

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 @@ -18,6 +18,7 @@
Li Yingxin ([email protected])
*/

#include <stddef.h>
#include <stdio.h>
#include <errno.h>
#include <string>
Expand Down

0 comments on commit 61cc990

Please sign in to comment.