Overview
Comment: | Move ObjC feature checks to OFObject.h.
This way, it is theoretically possible to compile ObjFW with one |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2edae50b86bc3dfc09d2b8bb99a40dca |
User & Date: | js on 2012-10-03 15:47:15 |
Other Links: | manifest | tags |
Context
2012-10-05
| ||
09:54 | Add -[OFDataArray description]. check-in: 23ad67cdf7 user: js tags: trunk | |
2012-10-03
| ||
15:47 | Move ObjC feature checks to OFObject.h. check-in: 2edae50b86 user: js tags: trunk | |
15:41 | Move definition of restricted to OFObject.h. check-in: 7239333455 user: js tags: trunk | |
Changes
Modified configure.ac from [0c2ce536c1] to [cc4568e947].
︙ | ︙ | |||
40 41 42 43 44 45 46 | AX_CHECK_COMPILER_FLAGS(-Wshorten-64-to-32, [OBJCFLAGS="$OBJCFLAGS -Wshorten-64-to-32"]) AX_CHECK_COMPILER_FLAGS(-Wsemicolon-before-method-body, [OBJCFLAGS="$OBJCFLAGS -Wsemicolon-before-method-body"]) AX_CHECK_COMPILER_FLAGS(-Wno-objc-root-class, [OBJCFLAGS="$OBJCFLAGS -Wno-objc-root-class"]) | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | AX_CHECK_COMPILER_FLAGS(-Wshorten-64-to-32, [OBJCFLAGS="$OBJCFLAGS -Wshorten-64-to-32"]) AX_CHECK_COMPILER_FLAGS(-Wsemicolon-before-method-body, [OBJCFLAGS="$OBJCFLAGS -Wsemicolon-before-method-body"]) AX_CHECK_COMPILER_FLAGS(-Wno-objc-root-class, [OBJCFLAGS="$OBJCFLAGS -Wno-objc-root-class"]) AC_MSG_CHECKING(whether Objective C compiler supports properties) AC_TRY_COMPILE([ @interface Foo { id bar; } @property (retain, nonatomic) id bar; @end ], [ Foo *foo = (id)0; [foo setBar: (id)0]; [foo bar]; ], [ AC_SUBST(PROPERTIESTESTS_M, "PropertiesTests.m") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(whether Objective C compiler supports blocks) old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -fblocks" AC_TRY_COMPILE([], [ int (^foo)(int bar); foo = ^ (int bar) { return 0; } ], [ AC_SUBST(BLOCKS_FLAGS, "-fblocks") AC_SUBST(OFBLOCKTESTS_M, "OFBlockTests.m") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) |
︙ | ︙ |
Modified src/OFObject.h from [d0b36af00e] to [5242dae164].
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #elif __STDC_VERSION__ < 199901L # define restrict #endif #ifndef __has_feature # define __has_feature(x) 0 #endif #if __has_feature(objc_bool) # undef YES # define YES __objc_yes # undef NO # define NO __objc_no #endif | > > > > > > > > > > > > > > > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #elif __STDC_VERSION__ < 199901L # define restrict #endif #ifndef __has_feature # define __has_feature(x) 0 #endif #if defined(__clang__) # define OF_HAVE_PROPERTIES # define OF_HAVE_OPTIONAL_PROTOCOLS # define OF_HAVE_FAST_ENUMERATION #elif defined(__GNUC__) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # define OF_HAVE_PROPERTIES # define OF_HAVE_OPTIONAL_PROTOCOLS # define OF_HAVE_FAST_ENUMERATION # endif #endif #if __has_feature(blocks) # define OF_HAVE_BLOCKS #endif #if __has_feature(objc_bool) # undef YES # define YES __objc_yes # undef NO # define NO __objc_no #endif |
︙ | ︙ |
Modified src/objfw-defs.h.in from [13f2356be6] to [2392df0876].
1 2 3 4 5 6 | #undef OF_APPLE_RUNTIME #undef OF_ATOMIC_OPS #undef OF_BIG_ENDIAN #undef OF_COMPILER_TLS #undef OF_FLOAT_BIG_ENDIAN #undef OF_HAVE_ASPRINTF | < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #undef OF_APPLE_RUNTIME #undef OF_ATOMIC_OPS #undef OF_BIG_ENDIAN #undef OF_COMPILER_TLS #undef OF_FLOAT_BIG_ENDIAN #undef OF_HAVE_ASPRINTF #undef OF_HAVE_GCC_ATOMIC_OPS #undef OF_HAVE_OSATOMIC #undef OF_HAVE_OSATOMIC_64 #undef OF_HAVE_PTHREADS #undef OF_HAVE_PTHREAD_SPINLOCKS #undef OF_HAVE_RECURSIVE_PTHREAD_MUTEXES #undef OF_HAVE_SCHED_YIELD #undef OF_HAVE_SYS_SELECT_H #undef OF_OBJFW_RUNTIME #undef OF_PLUGINS #undef OF_THREADS #undef SIZE_MAX |