summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-10-08 11:52:09 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-10-08 11:52:09 -0400
commit54d874b1233586844f87e79ae8f211af0a1cb7a6 (patch)
tree971b237ed4e34ec0c6c3dc2d84047bd7956ef3be /indra
parentc585ddb75e383cdd994d0d99fed8f2de8f955e3c (diff)
SL-16024: Resolve bizarre VS compile error. Thanks Callum!
It seems CALLBACK is a macro in some Microsoft header file. Bleah.
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/workqueue.h20
1 files changed, 12 insertions, 8 deletions
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 <typename CALLABLE, typename CALLBACK>
- bool postTo(std::weak_ptr<WorkQueue> 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 <typename CALLABLE, typename FOLLOWUP>
+ 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 <typename CALLABLE, typename CALLBACK>
- bool postTo(std::weak_ptr<WorkQueue> target,
- CALLABLE&& callable, CALLBACK&& callback)
+ template <typename CALLABLE, typename FOLLOWUP>
+ 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<WorkQueue> target,
+ BackJack(WorkQueue::weak_t target,
const WorkQueue::TimePoint& start,
const std::chrono::duration<Rep, Period>& interval,
CALLABLE&& callable):
@@ -291,7 +295,7 @@ namespace LL
}
private:
- std::weak_ptr<WorkQueue> mTarget;
+ WorkQueue::weak_t mTarget;
WorkQueue::TimePoint mStart;
std::chrono::duration<Rep, Period> mInterval;
CALLABLE mCallable;