X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=conout.c;h=c4c285bb59ec0f21c5c71d6af175a3f6d1626546;hp=1176e9bda81fc5a655c3508d6b3f0c80045505c9;hb=ff37abb0c7c60481e1264914fa5e02e9986c5cd9;hpb=87d9371a5c08f5b05ba70b11c63df80960b40831 diff --git a/conout.c b/conout.c index 1176e9b..c4c285b 100644 --- a/conout.c +++ b/conout.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013 + * Copyright (C) 2012, 2013, 2014, 2015 * Dale Weiler * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -20,9 +20,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#define GMQCC_PLATFORM_HEADER +#include #include "gmqcc.h" -#include "platform.h" #define GMQCC_IS_STDOUT(X) ((fs_file_t*)((void*)X) == (fs_file_t*)stdout) #define GMQCC_IS_STDERR(X) ((fs_file_t*)((void*)X) == (fs_file_t*)stderr) @@ -50,10 +49,8 @@ static con_t console; * checks. */ static void con_enablecolor(void) { - if (console.handle_err == (fs_file_t*)stderr || console.handle_err == (fs_file_t*)stdout) - console.color_err = !!(platform_isatty(STDERR_FILENO)); - if (console.handle_out == (fs_file_t*)stderr || console.handle_out == (fs_file_t*)stdout) - console.color_out = !!(platform_isatty(STDOUT_FILENO)); + console.color_err = util_isatty(console.handle_err); + console.color_out = util_isatty(console.handle_out); } /* @@ -216,8 +213,7 @@ void con_cprintmsg(lex_ctx_t ctx, int lvl, const char *msgtype, const char *msg, va_end (va); } -#ifndef QCVM_EXECUTOR -/* General error interface */ +/* General error interface: TODO seperate as part of the compiler front-end */ size_t compile_errors = 0; size_t compile_warnings = 0; size_t compile_Werrors = 0; @@ -282,4 +278,3 @@ bool GMQCC_WARN compile_warning(lex_ctx_t ctx, int warntype, const char *fmt, .. va_end(ap); return r; } -#endif