Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -66,10 +66,32 @@ AC_SUBST(PROPERTIESTESTS_M, "PropertiesTests.m") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ]) + +AC_MSG_CHECKING(whether Objective C compiler supports optional protocols) +AC_TRY_COMPILE([ + @protocol Proto + @optional + + (void)foo; + @end + + @interface Foo + @end + + @implementation Foo + @end +], [ + [Foo foo]; +], [ + AC_DEFINE(OF_HAVE_OPTIONAL_PROTOCOLS, 1, + [Compiler support for optional protocols]) + 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([], [ Index: src/objfw-defs.h.in ================================================================== --- src/objfw-defs.h.in +++ src/objfw-defs.h.in @@ -4,10 +4,11 @@ #undef OF_GNU_RUNTIME #undef OF_HAVE_ASPRINTF #undef OF_HAVE_BLOCKS #undef OF_HAVE_FAST_ENUMERATION #undef OF_HAVE_GCC_ATOMIC_OPS +#undef OF_HAVE_OPTIONAL_PROTOCOLS #undef OF_HAVE_OSATOMIC #undef OF_HAVE_OSATOMIC_64 #undef OF_HAVE_POLL #undef OF_HAVE_PROPERTIES #undef OF_HAVE_PTHREADS