19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
#import "OFObject.h"
#import "OFArray.h"
#import "OFLocalization.h"
#import "OFTimer.h"
#import "OFRunLoop.h"
#import "OFThread.h"
|
>
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/time.h>
#ifdef OF_APPLE_RUNTIME
# include <dlfcn.h>
#endif
#import "OFObject.h"
#import "OFArray.h"
#import "OFLocalization.h"
#import "OFTimer.h"
#import "OFRunLoop.h"
#import "OFThread.h"
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#import "instance.h"
#if defined(OF_HAVE_ATOMIC_OPS)
# import "atomic.h"
#elif defined(OF_HAVE_THREADS)
# import "threading.h"
#endif
#ifdef OF_APPLE_RUNTIME
extern double NSFoundationVersionNumber;
#endif
#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id of_forward(id, SEL, ...);
extern struct stret of_forward_stret(id, SEL, ...);
#else
# define of_forward of_method_not_found
# define of_forward_stret of_method_not_found_stret
#endif
|
<
<
<
<
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#import "instance.h"
#if defined(OF_HAVE_ATOMIC_OPS)
# import "atomic.h"
#elif defined(OF_HAVE_THREADS)
# import "threading.h"
#endif
#if defined(OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR)
extern id of_forward(id, SEL, ...);
extern struct stret of_forward_stret(id, SEL, ...);
#else
# define of_forward of_method_not_found
# define of_forward_stret of_method_not_found_stret
#endif
|
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
* against Foundation. Since CoreFoundation sets its own forward
* handler on load, we should not set ours, as this will break
* Foundation.
*
* Unfortunately, there is no way to check if a forward handler has
* already been set, so this is the best we can do.
*/
if (&NSFoundationVersionNumber == NULL)
objc_setForwardHandler((void *)&of_forward,
(void *)&of_forward_stret);
#else
objc_setForwardHandler((IMP)&of_forward, (IMP)&of_forward_stret);
#endif
objc_setEnumerationMutationHandler(enumerationMutationHandler);
|
|
|
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
* against Foundation. Since CoreFoundation sets its own forward
* handler on load, we should not set ours, as this will break
* Foundation.
*
* Unfortunately, there is no way to check if a forward handler has
* already been set, so this is the best we can do.
*/
if (dlsym(RTLD_DEFAULT, "NSFoundationVersionNumber") == NULL)
objc_setForwardHandler((void *)&of_forward,
(void *)&of_forward_stret);
#else
objc_setForwardHandler((IMP)&of_forward, (IMP)&of_forward_stret);
#endif
objc_setEnumerationMutationHandler(enumerationMutationHandler);
|