aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/pragma.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/asm/pragma.c b/asm/pragma.c
index 0a58e3f0..cbe0cc7b 100644
--- a/asm/pragma.c
+++ b/asm/pragma.c
@@ -83,13 +83,15 @@
*/
static struct pragma_facility global_pragmas[] =
{
- { "preproc", NULL }, /* This shouldn't happen... */
{ "asm", NULL },
{ "list", NULL },
{ "file", NULL },
{ "input", NULL },
+
+ /* None of these should actually happen... */
+ { "preproc", NULL }, /* This shouldn't happen... */
{ "output", NULL },
- { "debug", NULL },
+ { "debug", NULL },
{ "ignore", NULL },
{ NULL, NULL }
};
@@ -185,6 +187,15 @@ void process_pragma(char *str)
if (!nasm_stricmp(pragma.facility_name, "ignore"))
return;
+ /*
+ * The "output" and "debug" facilities are aliases for the
+ * current output and debug formats, respectively.
+ */
+ if (!nasm_stricmp(pragma.facility_name, "output"))
+ pragma.facility_name = ofmt->shortname;
+ if (!nasm_stricmp(pragma.facility_name, "debug"))
+ pragma.facility_name = dfmt->shortname;
+
pragma.opname = nasm_get_word(p, &p);
if (!pragma.opname)
pragma.opcode = D_none;