Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -34,10 +34,16 @@ #endif #ifdef OF_APPLE_RUNTIME # import #endif + +#if defined(__GNUC__) +# define restrict __restrict__ +#elif __STDC_VERSION__ < 199901L +# define restrict +#endif #ifndef __has_feature # define __has_feature(x) 0 #endif Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -26,12 +26,10 @@ #import "OFObject.h" #import "OFSerialization.h" #import "OFJSONRepresentation.h" -#import "macros.h" - @class OFConstantString; typedef uint32_t of_unichar_t; /** Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -34,10 +34,11 @@ #import "OFInitializationFailedException.h" #import "OFMalformedXMLException.h" #import "OFUnboundNamespaceException.h" #import "autorelease.h" +#import "macros.h" typedef void (*state_function)(id, SEL, const char*, size_t*, size_t*); static SEL selectors[OF_XMLPARSER_NUM_STATES]; static state_function lookupTable[OF_XMLPARSER_NUM_STATES]; Index: src/exceptions/OFAlreadyConnectedException.m ================================================================== --- src/exceptions/OFAlreadyConnectedException.m +++ src/exceptions/OFAlreadyConnectedException.m @@ -19,10 +19,12 @@ #import "OFAlreadyConnectedException.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFAlreadyConnectedException + exceptionWithClass: (Class)class_ socket: (OFTCPSocket*)socket { Index: src/exceptions/OFEnumerationMutationException.m ================================================================== --- src/exceptions/OFEnumerationMutationException.m +++ src/exceptions/OFEnumerationMutationException.m @@ -18,10 +18,12 @@ #import "OFEnumerationMutationException.h" #import "OFString.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFEnumerationMutationException + exceptionWithClass: (Class)class_ object: (id)object { Index: src/exceptions/OFHTTPRequestFailedException.m ================================================================== --- src/exceptions/OFHTTPRequestFailedException.m +++ src/exceptions/OFHTTPRequestFailedException.m @@ -21,10 +21,11 @@ #import "OFHTTPRequest.h" #import "OFNotImplementedException.h" #import "autorelease.h" +#import "common.h" @implementation OFHTTPRequestFailedException + exceptionWithClass: (Class)class_ request: (OFHTTPRequest*)request result: (OFHTTPRequestResult*)result Index: src/exceptions/OFHashAlreadyCalculatedException.m ================================================================== --- src/exceptions/OFHashAlreadyCalculatedException.m +++ src/exceptions/OFHashAlreadyCalculatedException.m @@ -19,10 +19,12 @@ #import "OFHashAlreadyCalculatedException.h" #import "OFString.h" #import "OFHash.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFHashAlreadyCalculatedException + exceptionWithClass: (Class)class_ hash: (OFHash*)hash { Index: src/exceptions/OFMalformedXMLException.m ================================================================== --- src/exceptions/OFMalformedXMLException.m +++ src/exceptions/OFMalformedXMLException.m @@ -19,10 +19,12 @@ #import "OFMalformedXMLException.h" #import "OFString.h" #import "OFXMLParser.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFMalformedXMLException + exceptionWithClass: (Class)class_ parser: (OFXMLParser*)parser { Index: src/exceptions/OFNotConnectedException.m ================================================================== --- src/exceptions/OFNotConnectedException.m +++ src/exceptions/OFNotConnectedException.m @@ -19,10 +19,12 @@ #import "OFNotConnectedException.h" #import "OFString.h" #import "OFTCPSocket.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFNotConnectedException + exceptionWithClass: (Class)class_ socket: (OFStreamSocket*)socket { Index: src/exceptions/OFSetOptionFailedException.m ================================================================== --- src/exceptions/OFSetOptionFailedException.m +++ src/exceptions/OFSetOptionFailedException.m @@ -19,10 +19,12 @@ #import "OFSetOptionFailedException.h" #import "OFString.h" #import "OFStream.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFSetOptionFailedException + exceptionWithClass: (Class)class_ stream: (OFStream*)stream { Index: src/exceptions/OFUnboundNamespaceException.m ================================================================== --- src/exceptions/OFUnboundNamespaceException.m +++ src/exceptions/OFUnboundNamespaceException.m @@ -18,10 +18,12 @@ #import "OFUnboundNamespaceException.h" #import "OFString.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFUnboundNamespaceException + exceptionWithClass: (Class)class_ namespace: (OFString*)ns { Index: src/exceptions/OFUnsupportedProtocolException.m ================================================================== --- src/exceptions/OFUnsupportedProtocolException.m +++ src/exceptions/OFUnsupportedProtocolException.m @@ -19,10 +19,12 @@ #import "OFUnsupportedProtocolException.h" #import "OFString.h" #import "OFURL.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFUnsupportedProtocolException + exceptionWithClass: (Class)class_ URL: (OFURL*)url { Index: src/exceptions/OFUnsupportedVersionException.m ================================================================== --- src/exceptions/OFUnsupportedVersionException.m +++ src/exceptions/OFUnsupportedVersionException.m @@ -18,10 +18,12 @@ #import "OFUnsupportedVersionException.h" #import "OFString.h" #import "OFNotImplementedException.h" + +#import "common.h" @implementation OFUnsupportedVersionException + exceptionWithClass: (Class)class_ version: (OFString*)version { Index: src/exceptions/common.h ================================================================== --- src/exceptions/common.h +++ src/exceptions/common.h @@ -13,10 +13,12 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include + +#import "macros.h" #ifndef _WIN32 #if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP) # include #endif Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -39,16 +39,10 @@ # define OF_LIKELY(cond) cond # define OF_UNLIKELY(cond) cond # define OF_CONST_FUNC #endif -#if defined(__GNUC__) -# define restrict __restrict__ -#elif __STDC_VERSION__ < 199901L -# define restrict -#endif - /* Required to build universal binaries on OS X */ #if __BIG_ENDIAN__ || __LITTLE_ENDIAN__ # if __BIG_ENDIAN__ && __LITTLE_ENDIAN__ # error __BIG_ENDIAN__ and __LITTLE_ENDIAN__ defined! # endif Index: src/of_asprintf.h ================================================================== --- src/of_asprintf.h +++ src/of_asprintf.h @@ -21,15 +21,13 @@ # define __STDC_CONSTANT_MACROS #endif #include -#import "macros.h" - #ifdef __cplusplus extern "C" { #endif extern int of_asprintf(char**, const char*, ...); extern int of_vasprintf(char**, const char*, va_list); #ifdef __cplusplus } #endif Index: tests/OFArrayTests.m ================================================================== --- tests/OFArrayTests.m +++ tests/OFArrayTests.m @@ -20,10 +20,12 @@ #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFEnumerationMutationException.h" #import "OFOutOfRangeException.h" + +#import "macros.h" #import "TestsAppDelegate.h" static OFString *module = @"OFArray"; static OFString *c_ary[] = { Index: tests/OFDataArrayTests.m ================================================================== --- tests/OFDataArrayTests.m +++ tests/OFDataArrayTests.m @@ -21,10 +21,12 @@ #import "OFDataArray.h" #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFOutOfRangeException.h" + +#import "macros.h" #import "TestsAppDelegate.h" static OFString *module; const char *str = "Hello!"; Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -27,10 +27,12 @@ #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFOutOfRangeException.h" + +#import "macros.h" #import "TestsAppDelegate.h" static OFString *module = @"OFString"; static OFString* whitespace[] = {