aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-08-27 16:38:48 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-08-27 16:42:41 -0700
commitd235408c65fc8176fdd94dd9f7d49074828bfa86 (patch)
tree1c1813452456e38e4af96a9046b96ac0e4b43998 /include
parenteaef851689e1d83608741cd5ac7c65e4e47d4acb (diff)
downloadnasm-d235408c65fc8176fdd94dd9f7d49074828bfa86.tar.gz
nasm-d235408c65fc8176fdd94dd9f7d49074828bfa86.tar.xz
nasm-d235408c65fc8176fdd94dd9f7d49074828bfa86.zip
preproc: standard macros now C-safe, %aliases off, fix %? recursion
Enough users expect the namespace starting with underscore to be safe for symbols. Change our private namespace from __foo__ to __?foo?__. Use %defalias to provide backwards compatiblity (by using %defalias instead of %define, we handle the case properly where the user changes the value.) Add a preprocessor directive: %aliases off ... to disable all smacro aliases and thereby making the namespace clean. Finally, fix infinite recursion when seeing %? or %?? due to paste_tokens(). If we don't paste anything, the expansion is done. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include')
-rw-r--r--include/nasm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/nasm.h b/include/nasm.h
index cfeb13ce..9bd42a75 100644
--- a/include/nasm.h
+++ b/include/nasm.h
@@ -186,12 +186,12 @@ enum token_type { /* token types, other than chars */
TOKEN_DBL_XOR, /* ^^ */
TOKEN_SEG, /* SEG */
TOKEN_WRT, /* WRT */
- TOKEN_FLOATIZE, /* __floatX__ */
+ TOKEN_FLOATIZE, /* __?floatX?__ */
TOKEN_STRFUNC, /* __utf16*__, __utf32*__ */
TOKEN_IFUNC, /* __ilog2*__ */
TOKEN_DECORATOR, /* decorators such as {...} */
- TOKEN_MASM_PTR, /* __masm_ptr__ for the masm package */
- TOKEN_MASM_FLAT, /* __masm_flat__ for the masm package */
+ TOKEN_MASM_PTR, /* __?masm_ptr?__ for the masm package */
+ TOKEN_MASM_FLAT, /* __?masm_flat?__ for the masm package */
TOKEN_OPMASK /* translated token for opmask registers */
};
@@ -808,7 +808,7 @@ struct ofmt {
/*
* This, if non-NULL, is a NULL-terminated list of `char *'s
* pointing to extra standard macros supplied by the object
- * format (e.g. a sensible initial default value of __SECT__,
+ * format (e.g. a sensible initial default value of __?SECT?__,
* and user-level equivalents for any format-specific
* directives).
*/