Work around msvc definition of NAN#702
Conversation
|
LoL, I took a stab at it here: #701 |
| JS_PROP_DOUBLE_DEF("MAX_VALUE", 1.7976931348623157e+308, 0 ), | ||
| JS_PROP_DOUBLE_DEF("MIN_VALUE", 5e-324, 0 ), | ||
| JS_PROP_DOUBLE_DEF("NaN", NAN, 0 ), | ||
| JS_PROP_U2D_DEF("NaN", 0x7FF8ull<<48, 0 ), // workaround for msvc |
There was a problem hiding this comment.
Would it make sense to define JS_FOLAT64_NAN like so?
There was a problem hiding this comment.
Already exists and defined as follows :)
#define JS_FLOAT64_NAN NANedit: I suppose you're asking to change JS_FLOAT64_NAN? Won't work, you can't write it as a compile-time expression.
I initially named it JS_COMPILE_TIME_NAN but then I thought "rule of three" and there are only two instances now.
|
Can you herry pick the 1st commit from #701 so we can test if this is it? |
That doesn't build/pass CI though, does it? |
The first commit is just the CI, which fails on master, if you add it here we'd know if your change fixes it :-) |
|
If this works you also want to add a "Fixes" for #622 |
NAN is reportedly no longer a compile-time expression in some versions of MSVC. Work around that by minting a NaN from a uint64. Fixes: quickjs-ng#622 Fixes: quickjs-ng#693
|
Oh, for posterity: another approach would have been to define them as e.g. |
I read in some other GH issue that that approach was no bueno for some reason with MSVC 🤷
TIL, makes sense! |
|
Let's test it: #704 :) |
|
Speaking of |
|
Not that I can see. I considered removing it but one thing at a time. |
NAN is reportedly no longer a compile-time expression in some versions of MSVC. Work around that by minting a NaN from a uint64.
Fixes: #693