|
| 1 | +From a38fd03fd9411ac5ffa94a523f0228f8ef75f058 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Luke Howard <lukeh@padl.com> |
| 3 | +Date: Tue, 4 Mar 2025 12:58:32 +1100 |
| 4 | +Subject: [PATCH] CFRunLoopTimerGetTolerance/CFRunLoopTimerSetTolerance for |
| 5 | + non-Mac |
| 6 | + |
| 7 | +--- |
| 8 | + Sources/CoreFoundation/CFRunLoop.c | 6 ------ |
| 9 | + 1 file changed, 6 deletions(-) |
| 10 | + |
| 11 | +diff --git a/Sources/CoreFoundation/CFRunLoop.c b/Sources/CoreFoundation/CFRunLoop.c |
| 12 | +index 91299fc5..3d2ed85d 100644 |
| 13 | +--- a/Sources/CoreFoundation/CFRunLoop.c |
| 14 | ++++ b/Sources/CoreFoundation/CFRunLoop.c |
| 15 | +@@ -4735,18 +4735,13 @@ void CFRunLoopTimerGetContext(CFRunLoopTimerRef rlt, CFRunLoopTimerContext *cont |
| 16 | + } |
| 17 | + |
| 18 | + CFTimeInterval CFRunLoopTimerGetTolerance(CFRunLoopTimerRef rlt) { |
| 19 | +-#if TARGET_OS_MAC |
| 20 | + CHECK_FOR_FORK(); |
| 21 | + CF_OBJC_FUNCDISPATCHV(CFRunLoopTimerGetTypeID(), CFTimeInterval, (NSTimer *)rlt, tolerance); |
| 22 | + __CFGenericValidateType(rlt, CFRunLoopTimerGetTypeID()); |
| 23 | + return rlt->_tolerance; |
| 24 | +-#else |
| 25 | +- return 0.0; |
| 26 | +-#endif |
| 27 | + } |
| 28 | + |
| 29 | + void CFRunLoopTimerSetTolerance(CFRunLoopTimerRef rlt, CFTimeInterval tolerance) { |
| 30 | +-#if TARGET_OS_MAC |
| 31 | + CHECK_FOR_FORK(); |
| 32 | + CF_OBJC_FUNCDISPATCHV(CFRunLoopTimerGetTypeID(), void, (NSTimer *)rlt, setTolerance:tolerance); |
| 33 | + __CFGenericValidateType(rlt, CFRunLoopTimerGetTypeID()); |
| 34 | +@@ -4764,7 +4759,6 @@ void CFRunLoopTimerSetTolerance(CFRunLoopTimerRef rlt, CFTimeInterval tolerance) |
| 35 | + if (tolerance < 0) tolerance = 0.0; |
| 36 | + rlt->_tolerance = tolerance; |
| 37 | + } |
| 38 | +-#endif |
| 39 | + } |
| 40 | + |
| 41 | + #endif /* __HAS_DISPATCH__ */ |
| 42 | +-- |
| 43 | +2.39.5 (Apple Git-154) |
| 44 | + |
0 commit comments