Support building the library on Mac OS X 10.4.x Tiger.
[blocksruntime.git] / config.h
blob2aae12eb05b8f25d5437e0edd01777e7604620fa
1 #ifndef _CONFIG_H_
2 #define _CONFIG_H_
4 #ifdef __APPLE__
6 #define HAVE_AVAILABILITY_MACROS_H 1
7 #define HAVE_TARGET_CONDITIONALS_H 1
8 #define HAVE_OSATOMIC_COMPARE_AND_SWAP_INT 1
9 #define HAVE_OSATOMIC_COMPARE_AND_SWAP_LONG 1
10 #define HAVE_LIBKERN_OSATOMIC_H
12 /* Be sneaky and turn OSAtomicCompareAndSwapInt into OSAtomicCompareAndSwap32
13 * and OSAtomicCompareAndSwapLong into either OSAtomicCompareAndSwap32
14 * or OSAtomicCompareAndSwap64 (depending on __LP64__) so that the library
15 * is Tiger compatible!
17 #include <libkern/OSAtomic.h>
18 #define OSAtomicCompareAndSwapInt OSAtomicCompareAndSwap32
19 #ifdef __LP64__
20 #define OSAtomicCompareAndSwapLong OSAtomicCompareAndSwap64
21 #else
22 #define OSAtomicCompareAndSwapLong OSAtomicCompareAndSwap32
23 #endif
25 #else /* !__APPLE__ */
27 #ifdef __GNUC__
29 #if !defined(__WIN32__) && !defined(_WIN32)
31 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) /* GCC >= 4.1 */
33 /* runtime.c ignores these if __WIN32__ or _WIN32 is defined */
34 #define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT 1
35 #define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_LONG 1
37 #else /* GCC earlier than version 4.1 */
39 #error GCC version 4.1 (or compatible) or later is required on non-apple, non-w32 targets
41 #endif /* GCC earlier than version 4.1 */
43 #endif /* !defined(__WIN32__) && !defined(_WIN32) */
45 #endif /* __GNUC__ */
47 #endif /* !__APPLE__ */
49 #endif /* _CONFIG_H_ */