From 79dbc9b866af494b711221f3f521aca77a58aab3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 25 Sep 2023 13:01:32 +0900 Subject: [PATCH] [qfcc] Add pragma control of code options --- tools/qfcc/source/pragma.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/qfcc/source/pragma.c b/tools/qfcc/source/pragma.c index f6b52e453..ed4f03d86 100644 --- a/tools/qfcc/source/pragma.c +++ b/tools/qfcc/source/pragma.c @@ -97,6 +97,21 @@ set_traditional (int traditional) opcode_init (); // reset the opcode table } +static void +set_code (pragma_arg_t *args) +{ + if (!args) { + warning (0, "missing code flag"); + return; + } + const char *flag = args->arg; + if (!parse_code_option (flag)) { + } + if (args->next) { + warning (0, "pragma code: ignoring extra arguments"); + } +} + static void set_bug (pragma_arg_t *args) { @@ -203,6 +218,8 @@ pragma_process () set_traditional (0); } else if (!strcmp (id, "ruamoko") || !strcmp (id, "raumoko")) { set_traditional (-1); + } else if (!strcmp (id, "code")) { + set_code (pragma_args->next); } else if (!strcmp (id, "bug")) { set_bug (pragma_args->next); } else if (!strcmp (id, "warn")) {