From: Dale Weiler Date: Sun, 23 Dec 2012 07:57:06 +0000 (+0000) Subject: con_default_out for opts.pp_only (removes recently added TODO .. and fixes a segfault) X-Git-Tag: 0.2~6 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=3b271076762fe2be2f46efabc42bfc2331965f17;hp=c3964cf29d0928b7c1decbd5a4d8dd38c3aff78a con_default_out for opts.pp_only (removes recently added TODO .. and fixes a segfault) --- diff --git a/conout.c b/conout.c index bf8b522..eb57d68 100644 --- a/conout.c +++ b/conout.c @@ -289,6 +289,17 @@ int con_change(const char *out, const char *err) { return 1; } +/* + * Defaultizer because stdio.h shouldn't be used anywhere except here + * and inside file.c To prevent mis-match of wrapper-interfaces. + */ +void con_default_out() { + console.handle_out = stdout; +} +void con_default_err() { + console.handle_err = stderr; +} + int con_verr(const char *fmt, va_list va) { return con_write(console.handle_err, fmt, va); } diff --git a/gmqcc.h b/gmqcc.h index 9495594..cbb8cb3 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -663,6 +663,9 @@ enum { LVL_ERROR }; +void con_default_out(); +void con_default_err(); + void con_vprintmsg (int level, const char *name, size_t line, const char *msgtype, const char *msg, va_list ap); void con_printmsg (int level, const char *name, size_t line, const char *msgtype, const char *msg, ...); void con_cvprintmsg(void *ctx, int lvl, const char *msgtype, const char *msg, va_list ap); diff --git a/main.c b/main.c index 5925cfa..2e1acb5 100644 --- a/main.c +++ b/main.c @@ -566,7 +566,7 @@ int main(int argc, char **argv) { } } else { - /* TODO: stdout without stdout .. */ + con_default_out(); } }