@@ -194,25 +194,10 @@ ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(Compiler does not support properties!) ]) -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" -]) - AC_CHECK_TOOL(AR, ar) AC_PROG_RANLIB AC_ARG_ENABLE(shared, AS_HELP_STRING([--disable-shared], [do not build shared library])) AS_IF([test x"$enable_shared" != x"no"], [ @@ -1191,10 +1176,11 @@ ;; *-*-msdosdjgpp*) have_processes="no" ;; *) + AC_HEADER_SYS_WAIT AC_CHECK_FUNCS(kill) AC_CHECK_FUNC(posix_spawnp, [ AS_IF([test x"$ac_cv_func_kill" = x"yes"], [ have_processes="yes" @@ -1241,10 +1227,28 @@ -o x"$enable_shared" = x"no"], [ AC_SUBST(OBJFW_BRIDGE_STATIC_LIB, "libobjfw-bridge.a") ]) ]) ]) + +dnl This needs to be after all other header checks, as they include unistd.h, +dnl which in old glibc versions uses __block. This is worked around in the code +dnl by undefining __USE_XOPEN. +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" +]) AS_IF([test x"$GOBJC" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror" AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs) @@ -1280,11 +1284,11 @@ { struct objc_class *_isa; Foo *_foo; } - @property (readonly, retain) Foo *foo; + @property (readonly, nonatomic) Foo *foo; + (Foo *)foo; @end @implementation Foo @@ -1355,10 +1359,21 @@ - (void)dealloc; @end @interface Foo: Object @end + + void + test(void) + { + if (sizeof(int) == 4) + __asm__ (""); + else if (sizeof(int) == 8) + __asm__ (""); + else + abort(); + } /* * Unfortunately, this cannot be shorter, as it only works when * it is used inside a macro. */