]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Added my awesome MT1997 PRNG, and use it instead of stdio's rand()/srand() .. which...
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 2e1acb5d1401d848f9b7fcfd57694a583f625430..a52e70449c4a038aa4dc372f19b1dd2fc13451b5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -23,6 +23,7 @@
  */
 #include "gmqcc.h"
 #include "lexer.h"
+#include <time.h>
 
 /* TODO: cleanup this whole file .. it's a fuckign mess */
 
@@ -261,6 +262,7 @@ static bool options_parse(int argc, char **argv) {
 
                 case 'E':
                     opts.pp_only = true;
+                    opts_set(opts.flags, FTEPP_PREDEFS, true); /* predefs on for -E */
                     break;
 
                 /* debug turns on -flno */
@@ -504,6 +506,8 @@ int main(int argc, char **argv) {
     con_init ();
     opts_init("progs.dat", COMPILER_GMQCC, (1024 << 3));
 
+    util_seed(time(0));
+
     if (!options_parse(argc, argv)) {
         return usage();
     }
@@ -566,7 +570,7 @@ int main(int argc, char **argv) {
             }
         }
         else {
-            con_default_out();
+            outfile = con_default_out();
         }
     }