]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
-fadjust-vector-fields is now on by default in -std=gmqcc
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 10 Nov 2012 19:21:02 +0000 (20:21 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 11 Nov 2012 09:13:01 +0000 (10:13 +0100)
main.c

diff --git a/main.c b/main.c
index a65a735ebb6b351442bf6c8be743bc31bc654a76..fbc54f235a90280fcd47f33a6f43b56970994869 100644 (file)
--- a/main.c
+++ b/main.c
@@ -161,6 +161,22 @@ static bool options_long_gcc(const char *optname, int *argc_, char ***argv_, cha
     return options_long_witharg_all(optname, argc_, argv_, out, 1, false);
 }
 
+static void options_set(uint32_t *flags, size_t idx, bool on)
+{
+    longbit lb = LONGBIT(idx);
+#if 0
+    if (on)
+        flags[lb.idx] |= (1<<(lb.bit));
+    else
+        flags[lb.idx] &= ~(1<<(lb.bit));
+#else
+    if (on)
+        flags[0] |= (1<<(lb));
+    else
+        flags[0] &= ~(1<<(lb));
+#endif
+}
+
 static bool options_parse(int argc, char **argv) {
     bool argend = false;
     size_t itr;
@@ -175,15 +191,19 @@ static bool options_parse(int argc, char **argv) {
         if (argv[0][0] == '-') {
     /* All gcc-type long options */
             if (options_long_gcc("std", &argc, &argv, &argarg)) {
-                if      (!strcmp(argarg, "gmqcc") || !strcmp(argarg, "default"))
+                if      (!strcmp(argarg, "gmqcc") || !strcmp(argarg, "default")) {
+                    options_set(opts_flags, ADJUST_VECTOR_FIELDS, true);
                     opts_standard = COMPILER_GMQCC;
-                else if (!strcmp(argarg, "qcc"))
+                } else if (!strcmp(argarg, "qcc")) {
+                    options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
                     opts_standard = COMPILER_QCC;
-                else if (!strcmp(argarg, "fte") || !strcmp(argarg, "fteqcc"))
+                } else if (!strcmp(argarg, "fte") || !strcmp(argarg, "fteqcc")) {
+                    options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
                     opts_standard = COMPILER_FTEQCC;
-                else if (!strcmp(argarg, "qccx"))
+                } else if (!strcmp(argarg, "qccx")) {
+                    options_set(opts_flags, ADJUST_VECTOR_FIELDS, false);
                     opts_standard = COMPILER_QCCX;
-                else {
+                else {
                     printf("Unknown standard: %s\n", argarg);
                     return false;
                 }
@@ -349,22 +369,6 @@ static bool options_parse(int argc, char **argv) {
     return true;
 }
 
-static void options_set(uint32_t *flags, size_t idx, bool on)
-{
-    longbit lb = LONGBIT(idx);
-#if 0
-    if (on)
-        flags[lb.idx] |= (1<<(lb.bit));
-    else
-        flags[lb.idx] &= ~(1<<(lb.bit));
-#else
-    if (on)
-        flags[0] |= (1<<(lb));
-    else
-        flags[0] &= ~(1<<(lb));
-#endif
-}
-
 /* returns the line number, or -1 on error */
 static bool progs_nextline(char **out, size_t *alen,FILE *src)
 {
@@ -416,6 +420,8 @@ int main(int argc, char **argv) {
     options_set(opts_warn, WARN_END_SYS_FIELDS, true);
     options_set(opts_warn, WARN_ASSIGN_FUNCTION_TYPES, true);
 
+    options_set(opts_flags, ADJUST_VECTOR_FIELDS, true);
+
     if (!options_parse(argc, argv)) {
         return usage();
     }