From b51a3184f926df3f911e90470bca7d05ec391f67 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Wed, 19 Aug 2026 10:45:17 +0100 Subject: [PATCH] Removed all PDOS related stuff --- report.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/report.c b/report.c index 1952abb..72ca4d1 100755 --- a/report.c +++ b/report.c @@ -13,19 +13,19 @@ extern char *xstrdup (const char *__p); unsigned long errors = 0; -#ifndef __PDOS__ -#if defined (_WIN32) -# include -static int OriginalConsoleColor = -1; -#endif - -static void reset_console_color (void) { - #if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) - +static void reset_console_color (void) { fprintf (stderr, "\033[0m"); +} +static void set_console_color (int color) { + fprintf (stderr, "\033[%dm", color); +} #elif defined (_WIN32) +# include +static int OriginalConsoleColor = -1; + +static void reset_console_color (void) { HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE); @@ -34,18 +34,10 @@ static void reset_console_color (void) { SetConsoleTextAttribute (hStdError, OriginalConsoleColor); OriginalConsoleColor = -1; -#endif - } static void set_console_color (int color) { -#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) - - fprintf (stderr, "\033[%dm", color); - -#elif defined (_WIN32) - HANDLE hStdError = GetStdHandle (STD_ERROR_HANDLE); WORD wColor; @@ -64,8 +56,6 @@ static void set_console_color (int color) { wColor = (OriginalConsoleColor & 0xF0) + (color & 0xF); SetConsoleTextAttribute (hStdError, wColor); -#endif - } #endif @@ -104,7 +94,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned if (type == REPORT_ERROR || type == REPORT_FATAL_ERROR) { -#ifndef __PDOS__ +#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32) set_console_color (COLOR_ERROR); #endif @@ -116,7 +106,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned } else if (type == REPORT_INTERNAL_ERROR) { -#ifndef __PDOS__ +#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32) set_console_color (COLOR_INTERNAL_ERROR); #endif @@ -124,7 +114,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned } else if (type == REPORT_WARNING) { -#ifndef __PDOS__ +#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32) set_console_color (COLOR_WARNING); #endif @@ -132,7 +122,7 @@ static void output_message (const char *filename, unsigned long lineno, unsigned } -#ifndef __PDOS__ +#if defined (unix) || defined (__unix) || defined (__unix__) || defined (__APPLE__) || defined (_WIN32) reset_console_color (); #endif -- 2.34.1