diff options
author | H. Peter Anvin <hpa@zytor.com> | 2019-08-27 16:38:48 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2019-08-27 16:42:41 -0700 |
commit | d235408c65fc8176fdd94dd9f7d49074828bfa86 (patch) | |
tree | 1c1813452456e38e4af96a9046b96ac0e4b43998 /macros/ifunc.mac | |
parent | eaef851689e1d83608741cd5ac7c65e4e47d4acb (diff) | |
download | nasm-d235408c65fc8176fdd94dd9f7d49074828bfa86.tar.gz |
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 'macros/ifunc.mac')
-rw-r--r-- | macros/ifunc.mac | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/macros/ifunc.mac b/macros/ifunc.mac index 0fafe8d6..4db46d34 100644 --- a/macros/ifunc.mac +++ b/macros/ifunc.mac @@ -39,10 +39,10 @@ USE: ifunc -%idefine ilog2(x) (__ilog2e__(x)) -%idefine ilog2e(x) (__ilog2e__(x)) -%idefine ilog2w(x) (__ilog2w__(x)) -%idefine ilog2fw(x) (__ilog2w__(x)) -%idefine ilog2f(x) (__ilog2f__(x)) -%idefine ilog2cw(x) (__ilog2w__(x) * 0 + __ilog2c__(x)) -%idefine ilog2c(x) (__ilog2c__(x)) +%idefine ilog2(x) (__?ilog2e?__(x)) +%idefine ilog2e(x) (__?ilog2e?__(x)) +%idefine ilog2w(x) (__?ilog2w?__(x)) +%idefine ilog2fw(x) (__?ilog2w?__(x)) +%idefine ilog2f(x) (__?ilog2f?__(x)) +%idefine ilog2cw(x) (__?ilog2w?__(x) * 0 + __?ilog2c?__(x)) +%idefine ilog2c(x) (__?ilog2c?__(x)) |