Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -41,14 +41,19 @@ #import "OFInvalidArgumentException.h" #import "OFNotOpenException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFWriteFailedException.h" + +#ifdef OF_IOS +# undef HAVE_ISATTY +#endif #ifdef OF_AMIGAOS # include # include +# undef HAVE_ISATTY #endif /* References for static linking */ #ifdef OF_WINDOWS void @@ -96,11 +101,11 @@ date.microsecond / 1000, me, getpid(), msg]; objc_autoreleasePoolPop(pool); } -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY static int colorToANSI(OFColor *color) { if ([color isEqual: [OFColor black]]) return 30; @@ -386,11 +391,11 @@ return OF_RETAIN_COUNT_MAX; } - (bool)hasTerminal { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY return isatty(_fd); #else return false; #endif } @@ -423,11 +428,11 @@ #endif } - (void)setForegroundColor: (OFColor *)color { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY int code; if (!isatty(_fd)) return; @@ -438,11 +443,11 @@ #endif } - (void)setBackgroundColor: (OFColor *)color { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY int code; if (!isatty(_fd)) return; @@ -453,41 +458,41 @@ #endif } - (void)reset { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; [self writeString: @"\033[0m"]; #endif } - (void)clear { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; [self writeString: @"\033[2J"]; #endif } - (void)eraseLine { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; [self writeString: @"\033[2K"]; #endif } - (void)setCursorColumn: (unsigned int)column { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; [self writeFormat: @"\033[%uG", column + 1]; #endif @@ -496,11 +501,11 @@ - (void)setCursorPosition: (of_point_t)position { if (position.x < 0 || position.y < 0) @throw [OFInvalidArgumentException exception]; -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; [self writeFormat: @"\033[%u;%uH", (unsigned)position.y + 1, (unsigned)position.x + 1]; @@ -507,11 +512,11 @@ #endif } - (void)setRelativeCursorPosition: (of_point_t)position { -#if defined(HAVE_ISATTY) && !defined(OF_AMIGAOS) +#ifdef HAVE_ISATTY if (!isatty(_fd)) return; if (position.x > 0) [self writeFormat: @"\033[%uC", (unsigned)position.x];