]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
con_default_out for opts.pp_only (removes recently added TODO .. and fixes a segfault)
authorDale Weiler <killfieldengine@gmail.com>
Sun, 23 Dec 2012 07:57:06 +0000 (07:57 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 23 Dec 2012 07:57:06 +0000 (07:57 +0000)
conout.c
gmqcc.h
main.c

index bf8b522648802b1b342760fdd81ecb8abfce20f2..eb57d68b69d048d8332d394d99f7de1739514538 100644 (file)
--- 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 949559442021428f8555b8ce672dbb38c9d02330..cbb8cb3f549b33f1e27d935989a9b04f2d5b346d 100644 (file)
--- 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 5925cfa68c8a82b7ac501ba6107c04390271c98b..2e1acb5d1401d848f9b7fcfd57694a583f625430 100644 (file)
--- a/main.c
+++ b/main.c
@@ -566,7 +566,7 @@ int main(int argc, char **argv) {
             }
         }
         else {
-         /* TODO: stdout without stdout .. */
+            con_default_out();
         }
     }