Mercurial > projects > ldc
diff dmd/root.c @ 535:f79bbd1d0b27
Add __APPLE__ to most #if linux compile time switches.
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sun, 24 Aug 2008 16:54:06 +0200 |
parents | f7ba5f705d59 |
children | cbd6c8073a32 |
line wrap: on
line diff
--- a/dmd/root.c Sun Aug 24 16:22:58 2008 +0200 +++ b/dmd/root.c Sun Aug 24 16:54:06 2008 +0200 @@ -23,7 +23,7 @@ #include <direct.h> #endif -#if linux +#if linux || __APPLE__ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -370,13 +370,13 @@ 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 @@ case '\r': continue; // ignore carriage returns -#if linux +#if linux || __APPLE__ case '~': buf.writestring(getenv("HOME")); continue; @@ -714,7 +714,7 @@ return 1; if (!e || !ext) return 0; -#if linux +#if linux || __APPLE__ return strcmp(e,ext) == 0; #endif #if _WIN32 @@ -733,7 +733,7 @@ #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 @@ int FileName::exists(const char *name) { -#if linux +#if linux || __APPLE__ struct stat st; if (stat(name, &st) < 0) @@ -822,7 +822,7 @@ #if _WIN32 if (path[strlen(path) - 1] != '\\') #endif -#if linux +#if linux || __APPLE__ if (path[strlen(path) - 1] != '\\') #endif { @@ -830,7 +830,7 @@ #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 @@ int File::read() { -#if linux +#if linux || __APPLE__ off_t size; ssize_t numread; int fd; @@ -1018,7 +1018,7 @@ int File::mmread() { -#if linux +#if linux || __APPLE__ return read(); #endif #if _WIN32 @@ -1072,7 +1072,7 @@ int File::write() { -#if linux +#if linux || __APPLE__ int fd; ssize_t numwritten; char *name; @@ -1145,7 +1145,7 @@ int File::append() { -#if linux +#if linux || __APPLE__ return 1; #endif #if _WIN32 @@ -1225,7 +1225,7 @@ int File::exists() { -#if linux +#if linux || __APPLE__ return 0; #endif #if _WIN32 @@ -1250,7 +1250,7 @@ void File::remove() { -#if linux +#if linux || __APPLE__ ::remove(this->name->toChars()); #endif #if _WIN32 @@ -1265,7 +1265,7 @@ Array *File::match(FileName *n) { -#if linux +#if linux || __APPLE__ return NULL; #endif #if _WIN32 @@ -1303,7 +1303,7 @@ int File::compareTime(File *f) { -#if linux +#if linux || __APPLE__ return 0; #endif #if _WIN32 @@ -1317,7 +1317,7 @@ void File::stat() { -#if linux +#if linux || __APPLE__ if (!touchtime) { touchtime = mem.calloc(1, sizeof(struct stat)); @@ -1622,7 +1622,7 @@ break; psize *= 2; #endif -#if linux +#if linux || __APPLE__ count = vsnprintf(p,psize,format,args); if (count == -1) psize *= 2; @@ -1654,7 +1654,7 @@ break; psize *= 2; #endif -#if linux +#if linux || __APPLE__ count = vsnwprintf(p,psize,format,args); if (count == -1) psize *= 2;