mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-18 14:21:36 +00:00
Some more changes: added redirout/redirerr command line options
This commit is contained in:
parent
dcacaca2e8
commit
0b8da9eeb4
3 changed files with 16 additions and 6 deletions
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
|||
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 += \
|
||||
|
|
5
con.c
5
con.c
|
@ -118,7 +118,7 @@ static void win_fputs(char *str, FILE *f) {
|
|||
|
||||
CONSOLE_SCREEN_BUFFER_INFO cinfo;
|
||||
GetConsoleScreenBufferInfo(
|
||||
(h == stdout) ?
|
||||
(GMQCC_IS_STDOUT(h)) ?
|
||||
GetStdHandle(STD_OUTPUT_HANDLE) :
|
||||
GetStdHandle(STD_ERROR_HANDLE), &cinfo
|
||||
);
|
||||
|
@ -172,7 +172,7 @@ static void win_fputs(char *str, FILE *f) {
|
|||
}
|
||||
/* restore */
|
||||
SetConsoleTextAttribute(
|
||||
(h == stdout) ?
|
||||
(GMQCC_IS_STDOUT(h)) ?
|
||||
GetStdHandle(STD_OUTPUT_HANDLE) :
|
||||
GetStdHandle(STD_ERROR_HANDLE),
|
||||
icolor
|
||||
|
@ -312,7 +312,6 @@ int con_out(const char *fmt, ...) {
|
|||
return ln;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Utility console message writes for lexer contexts. These will allow
|
||||
* for reporting of file:line based on lexer context, These are used
|
||||
|
|
15
main.c
15
main.c
|
@ -181,7 +181,10 @@ static void options_set(uint32_t *flags, size_t idx, bool on)
|
|||
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;
|
||||
|
@ -215,6 +218,13 @@ static bool options_parse(int argc, char **argv) {
|
|||
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;
|
||||
|
@ -371,6 +381,7 @@ static bool options_parse(int argc, char **argv) {
|
|||
items_add(item);
|
||||
}
|
||||
}
|
||||
con_change(redirout, redirerr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -529,7 +540,7 @@ srcdone:
|
|||
|
||||
cleanup:
|
||||
util_debug("COM", "cleaning ...\n");
|
||||
|
||||
con_close();
|
||||
mem_d(items_data);
|
||||
|
||||
parser_cleanup();
|
||||
|
|
Loading…
Reference in a new issue