| ︙ | | | ︙ | |
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# define OF_LIKELY(cond) (cond)
# define OF_UNLIKELY(cond) (cond)
# define OF_CONST_FUNC
# define OF_NO_RETURN_FUNC
# define OF_WEAK_REF(sym)
#endif
#ifdef OF_BIG_ENDIAN
# define OF_BYTE_ORDER_NATIVE OF_BYTE_ORDER_BIG_ENDIAN
#else
# define OF_BYTE_ORDER_NATIVE OF_BYTE_ORDER_LITTLE_ENDIAN
#endif
#if __STDC_VERSION__ >= 201112L
# define OF_ALIGNOF(type) _Alignof(type)
# define OF_ALIGNAS(type) _Alignas(type)
#else
# define OF_ALIGNOF(type) __alignof__(type)
# define OF_ALIGNAS(type) __attribute__((__aligned__(__alignof__(type))))
#endif
|
<
<
<
<
<
<
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# define OF_LIKELY(cond) (cond)
# define OF_UNLIKELY(cond) (cond)
# define OF_CONST_FUNC
# define OF_NO_RETURN_FUNC
# define OF_WEAK_REF(sym)
#endif
#if __STDC_VERSION__ >= 201112L
# define OF_ALIGNOF(type) _Alignof(type)
# define OF_ALIGNAS(type) _Alignas(type)
#else
# define OF_ALIGNOF(type) __alignof__(type)
# define OF_ALIGNAS(type) __attribute__((__aligned__(__alignof__(type))))
#endif
|
| ︙ | | | ︙ | |
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
# define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET
# endif
# endif
# endif
#endif
#define OF_RETAIN_COUNT_MAX UINT_MAX
#define OF_NOT_FOUND SIZE_MAX
#ifdef OBJC_COMPILING_RUNTIME
# define OF_ENSURE(cond) \
do { \
if OF_UNLIKELY (!(cond)) \
objc_error("ObjFWRT @ " __FILE__ ":" \
OF_STRINGIFY(__LINE__), \
|
<
|
346
347
348
349
350
351
352
353
354
355
356
357
358
359
|
# define OF_HAVE_FORWARDING_TARGET_FOR_SELECTOR_STRET
# endif
# endif
# endif
#endif
#define OF_RETAIN_COUNT_MAX UINT_MAX
#ifdef OBJC_COMPILING_RUNTIME
# define OF_ENSURE(cond) \
do { \
if OF_UNLIKELY (!(cond)) \
objc_error("ObjFWRT @ " __FILE__ ":" \
OF_STRINGIFY(__LINE__), \
|
| ︙ | | | ︙ | |
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
|
"in " __FILE__ ":%d:\n" #cond "\n", \
__LINE__); \
abort(); \
} \
} while (0)
#endif
#define OF_UNRECOGNIZED_SELECTOR of_method_not_found(self, _cmd);
#if __has_feature(objc_arc)
# define OF_INVALID_INIT_METHOD of_method_not_found(self, _cmd);
#else
# define OF_INVALID_INIT_METHOD \
@try { \
of_method_not_found(self, _cmd); \
} @catch (id e) { \
[self release]; \
@throw e; \
} \
\
abort();
#endif
|
|
|
|
|
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
"in " __FILE__ ":%d:\n" #cond "\n", \
__LINE__); \
abort(); \
} \
} while (0)
#endif
#define OF_UNRECOGNIZED_SELECTOR OFMethodNotFound(self, _cmd);
#if __has_feature(objc_arc)
# define OF_INVALID_INIT_METHOD OFMethodNotFound(self, _cmd);
#else
# define OF_INVALID_INIT_METHOD \
@try { \
OFMethodNotFound(self, _cmd); \
} @catch (id e) { \
[self release]; \
@throw e; \
} \
\
abort();
#endif
|
| ︙ | | | ︙ | |
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
|
(((bits) % (sizeof(value) * 8)) > 0 \
? ((value) >> ((bits) % (sizeof(value) * 8))) | \
((value) << (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8)))) \
: (value))
#define OF_ROUND_UP_POW2(pow2, value) (((value) + (pow2) - 1) & ~((pow2) - 1))
#define OF_HASH_INIT(hash) hash = of_hash_seed;
#define OF_HASH_ADD(hash, byte) \
{ \
hash += (uint8_t)(byte); \
hash += (hash << 10); \
hash ^= (hash >> 6); \
}
#define OF_HASH_FINALIZE(hash) \
|
|
|
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
|
(((bits) % (sizeof(value) * 8)) > 0 \
? ((value) >> ((bits) % (sizeof(value) * 8))) | \
((value) << (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8)))) \
: (value))
#define OF_ROUND_UP_POW2(pow2, value) (((value) + (pow2) - 1) & ~((pow2) - 1))
#define OF_HASH_INIT(hash) hash = OFHashSeed;
#define OF_HASH_ADD(hash, byte) \
{ \
hash += (uint8_t)(byte); \
hash += (hash << 10); \
hash ^= (hash >> 6); \
}
#define OF_HASH_FINALIZE(hash) \
|
| ︙ | | | ︙ | |