-static int usage() {
- printf("usage: %s [options] [files...]", app_name);
- printf("options:\n"
- " -h, --help show this help message\n"
- " -debug turns on compiler debug messages\n"
- " -memchk turns on compiler memory leak check\n");
- 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"
- " -std=qcc original QuakeC\n"
- " -std=fteqcc fteqcc QuakeC\n"
- " -std=gmqcc this compiler (default)\n");
- printf(" -W<warning> enable a warning\n"
- " -Wno-<warning> disable a warning\n"
- " -Wall enable all warnings\n"
- " -Werror treat warnings as errors\n");
- printf(" -force-crc=num force a specific checksum into the header\n");
- printf("\n");
- printf("flags:\n"
- " -fadjust-vector-fields\n"
- " when assigning a vector field, its _y and _z fields also get assigned\n"
- );
- return -1;
-}
-
-static bool options_setflag_all(const char *name, bool on, uint32_t *flags, const opts_flag_def *list, size_t listsize) {
- size_t i;
-
- for (i = 0; i < listsize; ++i) {
- if (!strcmp(name, list[i].name)) {
- longbit lb = list[i].bit;
-#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));