]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
-E switch to set opt_pp_only
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 16:58:21 +0000 (17:58 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 2 Nov 2012 17:33:51 +0000 (18:33 +0100)
gmqcc.h
main.c

diff --git a/gmqcc.h b/gmqcc.h
index 42a5fc6a166a254493ef178fa1014440acd4661f..437cc8ae353d489405f3e67e5fa6d8e7b2975785 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -1012,6 +1012,7 @@ extern bool        opts_dump;
 extern bool        opts_werror;
 extern bool        opts_forcecrc;
 extern uint16_t    opts_forced_crc;
+extern bool        opts_pp_only;
 
 /*===================================================================*/
 #define OPTS_FLAG(i) (!! (opts_flags[(i)/32] & (1<< ((i)%32))))
diff --git a/main.c b/main.c
index 0ea96c447a710a939e2f6a33bac4a893f1f9a43c..a65a735ebb6b351442bf6c8be743bc31bc654a76 100644 (file)
--- a/main.c
+++ b/main.c
@@ -34,6 +34,7 @@ bool        opts_memchk   = false;
 bool        opts_dump     = false;
 bool        opts_werror   = false;
 bool        opts_forcecrc = false;
+bool        opts_pp_only  = false;
 
 uint16_t    opts_forced_crc;
 
@@ -61,6 +62,7 @@ static int usage() {
     printf("  -o, --output=file      output file, defaults to progs.dat\n"
            "  -a filename            add an asm file to be assembled\n"
            "  -s filename            add a progs.src file to be used\n");
+    printf("  -E                     stop after preprocessing\n");
     printf("  -f<flag>               enable a flag\n"
            "  -fno-<flag>            disable a flag\n"
            "  -std standard          select one of the following standards\n"
@@ -212,6 +214,10 @@ static bool options_parse(int argc, char **argv) {
                     exit(0);
                     break;
 
+                case 'E':
+                    opts_pp_only = true;
+                    break;
+
                 /* handle all -fflags */
                 case 'f':
                     util_strtocmd(argv[0]+2, argv[0]+2, strlen(argv[0]+2)+1);