Skip to content

Commit e0f0749

Browse files
committed
fix(pyconfig): X87_double_rounding was reverted
1 parent cd4faa9 commit e0f0749

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/pylib/pyconfig/floats.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import ./util
44

55
AC_RUN_IFELSE X87_double_rounding, false:
6-
# ref "On IEEE 754, test should return 0 if rounding"
6+
# On IEEE 754, test should return 1 if rounding mode is round-to-nearest.
77
# maybe following is enough, but I still put origin C code below
8-
import std/fenv;quit int(fegetround()!=FE_TONEAREST)
8+
import std/fenv;quit int(fegetround()==FE_TONEAREST)
99
#[
1010
Detect whether system arithmetic is subject to x87-style double
1111
rounding issues. The result of this test has little meaning on non

src/pylib/pyconfig/util.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ proc from_c_int_expr(cacheName, cexpr: string; defval: NimNode): NimNode =
7171
result = quote do:
7272
from_c_int(`cexpr`, `defval`):
7373
{.emit: ["/*VARSECTION*/\n#define ", `pureVarId`, " ", `cexpr`, "\n"].}
74-
74+
#" <- for code lint
7575
macro from_c_int_underlined*(variable: static[string]; defval: int): int =
7676
let pureVar = variable.strip(chars = {'_'})
7777
from_c_int_expr(pureVar, variable, defval)
@@ -107,7 +107,7 @@ template from_c_int*(variable; defvar: int): int =
107107
bind noop
108108
from_c_int(variable, defvar, noop)
109109

110-
template AC_LINK_IFELSE*(variable, defval, code) = decl_ac_impl('c', variable, defval, code)
110+
template AC_LINK_IFELSE*(variable, defval, code) = decl_ac_impl('c', variable, defval, code) ## variable = whether code exits with 0
111111
template AC_RUN_IFELSE*(variable, defval, code) = decl_ac_impl(RunSubCmd, variable, defval, code)
112112

113113

0 commit comments

Comments
 (0)