Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -23,10 +23,11 @@ #import "OFFile.h" #import "OFString.h" #import "OFArray.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" +#import "macros.h" #ifdef _WIN32 # import #endif @@ -42,16 +43,10 @@ #endif #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH #define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH -#ifndef _WIN32 -# define PATH_DELIM '/' -#else -# define PATH_DELIM '\\' -#endif - OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; static int parse_mode(const char *mode) @@ -119,15 +114,15 @@ ssize_t i; if (path_len == 0) return @""; - if (path_c[path_len - 1] == PATH_DELIM) + if (path_c[path_len - 1] == OF_PATH_DELIM) path_len--; for (i = path_len - 1; i >= 0; i--) { - if (path_c[i] == PATH_DELIM) { + if (path_c[i] == OF_PATH_DELIM) { i++; break; } } Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -32,16 +32,10 @@ #import "macros.h" #import "asprintf.h" #import "unicode.h" -#ifndef _WIN32 -# define PATH_DELIM '/' -#else -# define PATH_DELIM '\\' -#endif - extern const uint16_t of_iso_8859_15[256]; extern const uint16_t of_windows_1252[256]; /* References for static linking */ void _references_to_categories_of_OFString() @@ -590,11 +584,11 @@ memcpy(string, [first cString], len); i = len; while ((component = va_arg(args, OFString*)) != nil) { len = [component length]; - string[i] = PATH_DELIM; + string[i] = OF_PATH_DELIM; memcpy(string + i + 1, [component cString], len); i += len + 1; } string[i] = '\0'; Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -44,10 +44,16 @@ # define OF_PPC_ASM # elif defined(__arm__) || defined(__ARM__) # define OF_ARM_ASM # endif #endif + +#ifndef _WIN32 +# define OF_PATH_DELIM '/' +#else +# define OF_PATH_DELIM '\\' +#endif static OF_INLINE uint16_t OF_BSWAP16_CONST(uint16_t i) { return (i & UINT16_C(0xFF00)) >> 8 |