From: Wolfgang (Blub) Bumiller Date: Sat, 10 Nov 2012 19:21:02 +0000 (+0100) Subject: -fadjust-vector-fields is now on by default in -std=gmqcc X-Git-Tag: 0.1~19^2~45 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bc43c6de479d62717f574effbd43a07d4765316a;p=xonotic%2Fgmqcc.git -fadjust-vector-fields is now on by default in -std=gmqcc --- diff --git a/main.c b/main.c index a65a735..fbc54f2 100644 --- 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(); }