Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -11,10 +11,15 @@ CFLAGS="$CFLAGS -Wall" OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions" OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString" LIBS="$LIBS -lobjc" + +if test x"$GCC" = x"yes"; then + CFLAGS="$CFLAGS -Werror" + OBJCFLAGS="$OBJCFLAGS -Werror" +fi AX_CHECK_COMPILER_FLAGS(-pipe, [ CFLAGS="$CFLAGS -pipe" OBJCFLAGS="$OBJCFLAGS -pipe"]) AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, Index: src/OFConstString.m ================================================================== --- src/OFConstString.m +++ src/OFConstString.m @@ -20,31 +20,22 @@ #import "OFString.h" #import "OFExceptions.h" #import "OFMacros.h" #ifndef __objc_INCLUDE_GNU -struct objc_class _OFConstStringClassReference; +void *_OFConstStringClassReference; #endif @implementation OFConstString #ifndef __objc_INCLUDE_GNU + (void)load { - Class cls = objc_getClass("OFConstString"); - memcpy(&_OFConstStringClassReference, cls, - sizeof(_OFConstStringClassReference)); - objc_addClass(&_OFConstStringClassReference); + objc_setFutureClass((Class)&_OFConstStringClassReference, + "OFConstString"); } #endif -- (BOOL)isKindOf: (Class)c -{ - if (c == [OFConstString class]) - return YES; - return NO; -} - - (const char*)cString { return string; }