aboutsummaryrefslogtreecommitdiffstats
path: root/macros/fp.mac
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 /macros/fp.mac
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 'macros/fp.mac')
-rw-r--r--macros/fp.mac24
1 files changed, 12 insertions, 12 deletions
diff --git a/macros/fp.mac b/macros/fp.mac
index 1334784b..eb297014 100644
--- a/macros/fp.mac
+++ b/macros/fp.mac
@@ -39,16 +39,16 @@
USE: fp
-%define Inf __Infinity__
-%define NaN __QNaN__
-%define QNaN __QNaN__
-%define SNaN __SNaN__
+%define Inf __?Infinity?__
+%define NaN __?QNaN?__
+%define QNaN __?QNaN?__
+%define SNaN __?SNaN?__
-%define float8(x) __float8__(x)
-%define float16(x) __float16__(x)
-%define float32(x) __float32__(x)
-%define float64(x) __float64__(x)
-%define float80m(x) __float80m__(x)
-%define float80e(x) __float80e__(x)
-%define float128l(x) __float128l__(x)
-%define float128h(x) __float128h__(x)
+%define float8(x) __?float8?__(x)
+%define float16(x) __?float16?__(x)
+%define float32(x) __?float32?__(x)
+%define float64(x) __?float64?__(x)
+%define float80m(x) __?float80m?__(x)
+%define float80e(x) __?float80e?__(x)
+%define float128l(x) __?float128l?__(x)
+%define float128h(x) __?float128h?__(x)