with NASM.
svn path=/trunk/yasm/; revision=1636
break;
}
}
+ if (!got_it && !other_option_handler(argv[0]))
+ got_it = 1;
if (!got_it) {
print_error(_("warning: unrecognized option `%s'"),
argv[0]);
break;
}
}
+ if (!got_it && !other_option_handler(argv[0]))
+ got_it = 1;
if (!got_it) {
print_error(_("warning: unrecognized option `%s'"),
argv[0]);
/* handle everything that is not an option */
int not_an_option_handler(char *param);
+/* handle possibly other special-case options; no parameters allowed */
+int other_option_handler(char *option);
+
/* parse command line calling handlers when appropriate
* argc, argv - pass directly from main(argc,argv)
* options - array of options
return 0;
}
+int
+other_option_handler(char *option)
+{
+ /* Accept, but ignore, -O and -Onnn, for compatibility with NASM. */
+ if (option[0] == '-' && option[1] == 'O') {
+ int n = 2;
+ for (;;) {
+ if (option[n] == '\0')
+ return 0;
+ if (!isdigit(option[n]))
+ return 1;
+ n++;
+ }
+ }
+ return 1;
+}
+
static int
opt_special_handler(/*@unused@*/ char *cmd, /*@unused@*/ char *param, int extra)
{