CC ?= clang
-CFLAGS += -Wall -I. -fomit-frame-pointer -fno-stack-protector
+CFLAGS += -Wall -I. -fomit-frame-pointer -fno-stack-protector -fno-common
#turn on tons of warnings if clang is present
ifeq ($(CC), clang)
CFLAGS += \
CONSOLE_SCREEN_BUFFER_INFO cinfo;
GetConsoleScreenBufferInfo(
- (h == stdout) ?
+ (GMQCC_IS_STDOUT(h)) ?
GetStdHandle(STD_OUTPUT_HANDLE) :
GetStdHandle(STD_ERROR_HANDLE), &cinfo
);
}
/* restore */
SetConsoleTextAttribute(
- (h == stdout) ?
+ (GMQCC_IS_STDOUT(h)) ?
GetStdHandle(STD_OUTPUT_HANDLE) :
GetStdHandle(STD_ERROR_HANDLE),
icolor
return ln;
}
-
/*
* Utility console message writes for lexer contexts. These will allow
* for reporting of file:line based on lexer context, These are used
static bool options_parse(int argc, char **argv) {
bool argend = false;
size_t itr;
- char buffer[1024];
+ char buffer[1024];
+ char *redirout = (char*)stdout;
+ char *redirerr = (char*)stderr;
+
while (!argend && argc > 1) {
char *argarg;
argitem item;
opts_forced_crc = strtol(argarg, NULL, 0);
continue;
}
+ if (options_long_gcc("redirout", &argc, &argv, &redirout)) {
+ continue;
+ }
+ if (options_long_gcc("redirerr", &argc, &argv, &redirerr)) {
+ continue;
+ }
+
if (!strcmp(argv[0]+1, "debug")) {
opts_debug = true;
continue;
items_add(item);
}
}
+ con_change(redirout, redirerr);
return true;
}
cleanup:
util_debug("COM", "cleaning ...\n");
-
+ con_close();
mem_d(items_data);
parser_cleanup();