Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -60,10 +60,11 @@ OFXMLElement+Serialization.m \ OFXMLElementBuilder.m \ OFXMLNode.m \ OFXMLParser.m \ OFXMLProcessingInstructions.m \ + ${AUTORELEASE_M} \ base64.m \ of_asprintf.m \ of_strptime.m \ unicode.m @@ -92,11 +93,10 @@ ${OFSTREAMOBSERVER_POLL_M} \ ${OFSTREAMOBSERVER_SELECT_M} \ OFString_UTF8.m \ OFTCPSocket+SOCKS5.m \ ${ASPRINTF_M} \ - ${AUTORELEASE_M} \ ${FOUNDATION_COMPAT_M} \ iso_8859_15.m \ windows_1252.m OBJS_EXTRA = ${EXCEPTIONS_EXCEPTIONS_A} ${RUNTIME_RUNTIME_A} Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -28,13 +28,11 @@ # import "threading.h" # import "OFInitializationFailedException.h" #endif -extern id _objc_rootAutorelease(id); -extern void* objc_autoreleasePoolPush(void); -extern void objc_autoreleasePoolPop(void*); +#import "autorelease.h" #ifdef OF_COMPILER_TLS static __thread void *first = NULL; #else static of_tlskey_t firstKey; Index: src/ObjFW.h ================================================================== --- src/ObjFW.h +++ src/ObjFW.h @@ -137,9 +137,10 @@ # import "OFThread.h" # import "OFThreadPool.h" # import "threading.h" #endif +#import "autorelease.h" #import "asprintf.h" #import "base64.h" #import "of_asprintf.h" #import "of_strptime.h" ADDED src/autorelease.h Index: src/autorelease.h ================================================================== --- src/autorelease.h +++ src/autorelease.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2008, 2009, 2010, 2011, 2012 + * Jonathan Schleifer + * + * All rights reserved. + * + * This file is part of ObjFW. It may be distributed under the terms of the + * Q Public License 1.0, which can be found in the file LICENSE.QPL included in + * the packaging of this file. + * + * Alternatively, it may be distributed under the terms of the GNU General + * Public License, either version 2 or 3, which can be found in the file + * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this + * file. + */ + +#ifdef __cplusplus +extern "C" { +#endif +extern void* objc_autoreleasePoolPush(); +extern void objc_autoreleasePoolPop(void*); +extern id _objc_rootAutorelease(id object); +#ifdef __cplusplus +} +#endif Index: src/autorelease.m ================================================================== --- src/autorelease.m +++ src/autorelease.m @@ -23,10 +23,12 @@ #ifndef OF_COMPILER_TLS # import "threading.h" #endif #import "macros.h" + +#import "autorelease.h" #ifdef OF_COMPILER_TLS static __thread id *objects = NULL; static __thread id *top = NULL; static __thread size_t size = 0;