From 81de0c4b23520181ed003b9c626c9a73afd4cc5d Mon Sep 17 00:00:00 2001 From: Jacob Carlborg Date: Sun, 24 Aug 2008 16:54:06 +0200 Subject: [PATCH] Add __APPLE__ to most #if linux compile time switches. --- dmd/attrib.c | 2 +- dmd/doc.c | 2 +- dmd/expression.c | 2 +- dmd/hdrgen.c | 2 +- dmd/inifile.c | 2 +- dmd/macro.c | 2 +- dmd/man.c | 2 +- dmd/mars.c | 6 +++--- dmd/opover.c | 2 +- dmd/root.c | 42 +++++++++++++++++++++--------------------- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dmd/attrib.c b/dmd/attrib.c index b709683a..cf836c12 100644 --- a/dmd/attrib.c +++ b/dmd/attrib.c @@ -14,7 +14,7 @@ #if _WIN32 || IN_GCC || IN_LLVM #include "mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #endif diff --git a/dmd/doc.c b/dmd/doc.c index c32b7a4a..f3fb859f 100644 --- a/dmd/doc.c +++ b/dmd/doc.c @@ -21,7 +21,7 @@ #else #if _WIN32 #include "..\root\mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #else #error "fix this" diff --git a/dmd/expression.c b/dmd/expression.c index 8a42edce..44e1508c 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -38,7 +38,7 @@ extern "C" char * __cdecl __locale_decpoint; #include "mem.h" #elif _WIN32 #include "..\root\mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #endif diff --git a/dmd/hdrgen.c b/dmd/hdrgen.c index f99c689b..64d6c081 100644 --- a/dmd/hdrgen.c +++ b/dmd/hdrgen.c @@ -29,7 +29,7 @@ #else #if _WIN32 #include "..\root\mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #else #error "fix this" diff --git a/dmd/inifile.c b/dmd/inifile.c index d0186624..2a648478 100644 --- a/dmd/inifile.c +++ b/dmd/inifile.c @@ -79,7 +79,7 @@ void inifile(char *argv0, char *inifile) filename = FileName::replaceName(argv0, inifile); if (!FileName::exists(filename)) { -#if linux +#if linux || __APPLE__ #if 0 #if __GLIBC__ // This fix by Thomas Kuehne diff --git a/dmd/macro.c b/dmd/macro.c index 809c88dc..0ab07e07 100644 --- a/dmd/macro.c +++ b/dmd/macro.c @@ -21,7 +21,7 @@ #else #if _WIN32 #include "..\root\mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #else #error "fix this" diff --git a/dmd/man.c b/dmd/man.c index 7c87dac2..daa30108 100644 --- a/dmd/man.c +++ b/dmd/man.c @@ -26,7 +26,7 @@ void browse(const char *url) #endif -#if linux +#if linux || __APPLE__ #include #include diff --git a/dmd/mars.c b/dmd/mars.c index 491211ba..167b9246 100644 --- a/dmd/mars.c +++ b/dmd/mars.c @@ -19,7 +19,7 @@ #include #endif -#if linux +#if linux || __APPLE__ #include #elif _WIN32 #include @@ -60,7 +60,7 @@ Global::Global() bc_ext = "bc"; #if _WIN32 nativeobj_ext = "obj"; -#elif linux +#elif linux || __APPLE__ nativeobj_ext = "o"; #else #error "fix this" @@ -323,7 +323,7 @@ int main(int argc, char *argv[]) #if _WIN32 inifile(global.params.argv0, "llvmdc.ini"); -#elif linux +#elif linux || __APPLE__ inifile(global.params.argv0, "llvmdc.conf"); #else #error diff --git a/dmd/opover.c b/dmd/opover.c index c6b7940e..f763ee1d 100644 --- a/dmd/opover.c +++ b/dmd/opover.c @@ -20,7 +20,7 @@ #if IN_GCC || IN_LLVM #include "mem.h" -#elif linux +#elif linux || __APPLE__ #include "../root/mem.h" #elif _WIN32 #include "..\root\mem.h" diff --git a/dmd/root.c b/dmd/root.c index dbc3d635..d0f12838 100644 --- a/dmd/root.c +++ b/dmd/root.c @@ -23,7 +23,7 @@ #include #endif -#if linux +#if linux || __APPLE__ #include #include #include @@ -370,13 +370,13 @@ Array *FileName::splitPath(const char *path) instring ^= 1; // toggle inside/outside of string continue; -#if MACINTOSH +/*#if MACINTOSH case ',': -#endif +#endif*/ #if _WIN32 case ';': #endif -#if linux +#if linux || __APPLE__ case ':': #endif p++; @@ -390,7 +390,7 @@ Array *FileName::splitPath(const char *path) case '\r': continue; // ignore carriage returns -#if linux +#if linux || __APPLE__ case '~': buf.writestring(getenv("HOME")); continue; @@ -714,7 +714,7 @@ int FileName::equalsExt(const char *ext) return 1; if (!e || !ext) return 0; -#if linux +#if linux || __APPLE__ return strcmp(e,ext) == 0; #endif #if _WIN32 @@ -733,7 +733,7 @@ void FileName::CopyTo(FileName *to) #if _WIN32 file.touchtime = mem.malloc(sizeof(WIN32_FIND_DATAA)); // keep same file time #endif -#if linux +#if linux || __APPLE__ file.touchtime = mem.malloc(sizeof(struct stat)); // keep same file time #endif file.readv(); @@ -775,7 +775,7 @@ char *FileName::searchPath(Array *path, char *name, int cwd) int FileName::exists(const char *name) { -#if linux +#if linux || __APPLE__ struct stat st; if (stat(name, &st) < 0) @@ -822,7 +822,7 @@ void FileName::ensurePathExists(const char *path) #if _WIN32 if (path[strlen(path) - 1] != '\\') #endif -#if linux +#if linux || __APPLE__ if (path[strlen(path) - 1] != '\\') #endif { @@ -830,7 +830,7 @@ void FileName::ensurePathExists(const char *path) #if _WIN32 if (mkdir(path)) #endif -#if linux +#if linux || __APPLE__ if (mkdir(path, 0777)) #endif error("cannot create directory %s", path); @@ -886,7 +886,7 @@ void File::mark() int File::read() { -#if linux +#if linux || __APPLE__ off_t size; ssize_t numread; int fd; @@ -1018,7 +1018,7 @@ err1: int File::mmread() { -#if linux +#if linux || __APPLE__ return read(); #endif #if _WIN32 @@ -1072,7 +1072,7 @@ Lerr: int File::write() { -#if linux +#if linux || __APPLE__ int fd; ssize_t numwritten; char *name; @@ -1145,7 +1145,7 @@ err: int File::append() { -#if linux +#if linux || __APPLE__ return 1; #endif #if _WIN32 @@ -1225,7 +1225,7 @@ void File::appendv() int File::exists() { -#if linux +#if linux || __APPLE__ return 0; #endif #if _WIN32 @@ -1250,7 +1250,7 @@ int File::exists() void File::remove() { -#if linux +#if linux || __APPLE__ ::remove(this->name->toChars()); #endif #if _WIN32 @@ -1265,7 +1265,7 @@ Array *File::match(char *n) Array *File::match(FileName *n) { -#if linux +#if linux || __APPLE__ return NULL; #endif #if _WIN32 @@ -1303,7 +1303,7 @@ Array *File::match(FileName *n) int File::compareTime(File *f) { -#if linux +#if linux || __APPLE__ return 0; #endif #if _WIN32 @@ -1317,7 +1317,7 @@ int File::compareTime(File *f) void File::stat() { -#if linux +#if linux || __APPLE__ if (!touchtime) { touchtime = mem.calloc(1, sizeof(struct stat)); @@ -1622,7 +1622,7 @@ void OutBuffer::vprintf(const char *format, va_list args) break; psize *= 2; #endif -#if linux +#if linux || __APPLE__ count = vsnprintf(p,psize,format,args); if (count == -1) psize *= 2; @@ -1654,7 +1654,7 @@ void OutBuffer::vprintf(const wchar_t *format, va_list args) break; psize *= 2; #endif -#if linux +#if linux || __APPLE__ count = vsnwprintf(p,psize,format,args); if (count == -1) psize *= 2;