mangle names in nimbase.h using cppDefine (#19395) [backport]
mangle names in nimbase.h fix comments
This commit is contained in:
parent
2c5b367001
commit
4f6b59de96
2 changed files with 21 additions and 0 deletions
|
|
@ -3,6 +3,11 @@
|
||||||
cppDefine "errno"
|
cppDefine "errno"
|
||||||
cppDefine "unix"
|
cppDefine "unix"
|
||||||
|
|
||||||
|
# mangle the macro names in nimbase.h
|
||||||
|
cppDefine "NAN_INFINITY"
|
||||||
|
cppDefine "INF"
|
||||||
|
cppDefine "NAN"
|
||||||
|
|
||||||
when defined(nimStrictMode):
|
when defined(nimStrictMode):
|
||||||
# xxx add more flags here, and use `-d:nimStrictMode` in more contexts in CI.
|
# xxx add more flags here, and use `-d:nimStrictMode` in more contexts in CI.
|
||||||
|
|
||||||
|
|
|
||||||
16
tests/ccgbugs/tmangle.nim
Normal file
16
tests/ccgbugs/tmangle.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
block:
|
||||||
|
proc hello() =
|
||||||
|
let NAN_INFINITY = 12
|
||||||
|
doAssert NAN_INFINITY == 12
|
||||||
|
let INF = "2.0"
|
||||||
|
doAssert INF == "2.0"
|
||||||
|
let NAN = 2.3
|
||||||
|
doAssert NAN == 2.3
|
||||||
|
|
||||||
|
hello()
|
||||||
|
|
||||||
|
block:
|
||||||
|
proc hello(NAN: float) =
|
||||||
|
doAssert NAN == 2.0
|
||||||
|
|
||||||
|
hello(2.0)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue