From 54d874b1233586844f87e79ae8f211af0a1cb7a6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Oct 2021 11:52:09 -0400 Subject: SL-16024: Resolve bizarre VS compile error. Thanks Callum! It seems CALLBACK is a macro in some Microsoft header file. Bleah. --- indra/llcommon/workqueue.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/workqueue.h') diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h index a52f7b0e26..b88aef989a 100644 --- a/indra/llcommon/workqueue.h +++ b/indra/llcommon/workqueue.h @@ -104,9 +104,13 @@ namespace LL * Returns true if able to post, false if the other WorkQueue is * inaccessible. */ - template - bool postTo(std::weak_ptr target, - const TimePoint& time, CALLABLE&& callable, CALLBACK&& callback) + // Apparently some Microsoft header file defines a macro CALLBACK? The + // natural template argument name CALLBACK produces very weird Visual + // Studio compile errors that seem utterly unrelated to this source + // code. + template + bool postTo(WorkQueue::weak_t target, + const TimePoint& time, CALLABLE&& callable, FOLLOWUP&& callback) { // We're being asked to post to the WorkQueue at target. // target is a weak_ptr: have to lock it to check it. @@ -170,9 +174,9 @@ namespace LL * Returns true if able to post, false if the other WorkQueue is * inaccessible. */ - template - bool postTo(std::weak_ptr target, - CALLABLE&& callable, CALLBACK&& callback) + template + bool postTo(WorkQueue::weak_t target, + CALLABLE&& callable, FOLLOWUP&& callback) { return postTo(target, TimePoint::clock::now(), std::move(callable), std::move(callback)); } @@ -243,7 +247,7 @@ namespace LL { public: // bind the desired data - BackJack(std::weak_ptr target, + BackJack(WorkQueue::weak_t target, const WorkQueue::TimePoint& start, const std::chrono::duration& interval, CALLABLE&& callable): @@ -291,7 +295,7 @@ namespace LL } private: - std::weak_ptr mTarget; + WorkQueue::weak_t mTarget; WorkQueue::TimePoint mStart; std::chrono::duration mInterval; CALLABLE mCallable; -- cgit v1.2.3