Skip to content

Commit fabf644

Browse files
committed
RunLoop: hoist macro definitions before use
Ensure that the local macro definitions are defined early enough for the forward declarations to be provided for the use.
1 parent 2b09c85 commit fabf644

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

CoreFoundation/RunLoop.subproj/CFRunLoop.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ CF_INLINE uint64_t check_uint64_add(uint64_t x, uint64_t y, int32_t* err) {
4848
};
4949
#endif
5050

51+
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_WINDOWS
52+
#define USE_DISPATCH_SOURCE_FOR_TIMERS __HAS_DISPATCH__
53+
#define USE_MK_TIMER_TOO 1
54+
#else
55+
#define USE_DISPATCH_SOURCE_FOR_TIMERS 0
56+
#define USE_MK_TIMER_TOO 1
57+
#endif
58+
5159
#if __HAS_DISPATCH__
5260
#if __has_include(<dispatch/private.h>)
5361
#include <dispatch/private.h>
@@ -125,14 +133,6 @@ CF_EXPORT _CFThreadRef _CF_pthread_main_thread_np(void);
125133
#include "Block_private.h"
126134
#endif
127135

128-
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_WINDOWS
129-
#define USE_DISPATCH_SOURCE_FOR_TIMERS __HAS_DISPATCH__
130-
#define USE_MK_TIMER_TOO 1
131-
#else
132-
#define USE_DISPATCH_SOURCE_FOR_TIMERS 0
133-
#define USE_MK_TIMER_TOO 1
134-
#endif
135-
136136
// Open source CF may not have this defined.
137137
#ifndef cf_trace
138138
#define cf_trace(...) do {} while (0)

0 commit comments

Comments
 (0)