Skip to content

Add Windows SDK CI #701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,36 @@ jobs:
build\run-test262.exe -c tests.conf
build\function_source.exe

windows-sdk:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64, Win32]
buildType: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install windows sdk
uses: ChristopheLav/windows-sdk-install@v1
with:
version-sdk: 26100
features: 'OptionId.DesktopCPPx86,OptionId.DesktopCPPx64'
- name: build
run: |
cmake -B build -DBUILD_EXAMPLES=ON -DCMAKE_SYSTEM_VERSION="10.0.26100.0" -A ${{matrix.arch}}
cmake --build build --config ${{matrix.buildType}}
- name: stats
run: |
build\${{matrix.buildType}}\qjs.exe -qd
- name: test
run: |
cp build\${{matrix.buildType}}\fib.dll examples\
cp build\${{matrix.buildType}}\point.dll examples\
build\${{matrix.buildType}}\qjs.exe examples\test_fib.js
build\${{matrix.buildType}}\qjs.exe examples\test_point.js
build\${{matrix.buildType}}\run-test262.exe -c tests.conf
build\${{matrix.buildType}}\function_source.exe

windows-mingw:
runs-on: windows-latest
strategy:
Expand Down
14 changes: 7 additions & 7 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41116,7 +41116,7 @@ static const JSCFunctionListEntry js_number_funcs[] = {
JS_CFUNC_DEF("isSafeInteger", 1, js_number_isSafeInteger ),
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_DOUBLE_DEF("NaN", JS_FLOAT64_NAN, 0 ),
JS_PROP_DOUBLE_DEF("NEGATIVE_INFINITY", -INFINITY, 0 ),
JS_PROP_DOUBLE_DEF("POSITIVE_INFINITY", INFINITY, 0 ),
JS_PROP_DOUBLE_DEF("EPSILON", 2.220446049250313e-16, 0 ), /* ES6 */
Expand Down Expand Up @@ -50197,7 +50197,7 @@ static const JSCFunctionListEntry js_global_funcs[] = {
JS_CFUNC_DEF("escape", 1, js_global_escape ),
JS_CFUNC_DEF("unescape", 1, js_global_unescape ),
JS_PROP_DOUBLE_DEF("Infinity", 1.0 / 0.0, 0 ),
JS_PROP_DOUBLE_DEF("NaN", NAN, 0 ),
JS_PROP_DOUBLE_DEF("NaN", JS_FLOAT64_NAN, 0 ),
JS_PROP_UNDEFINED_DEF("undefined", 0 ),
JS_PROP_STRING_DEF("[Symbol.toStringTag]", "global", JS_PROP_CONFIGURABLE ),
};
Expand Down Expand Up @@ -50337,7 +50337,7 @@ static double time_clip(double t) {
if (t >= -8.64e15 && t <= 8.64e15)
return trunc(t) + 0.0; /* convert -0 to +0 */
else
return NAN;
return JS_FLOAT64_NAN;
}

/* The spec mandates the use of 'double' and it specifies the order
Expand All @@ -50357,7 +50357,7 @@ static double set_date_fields(double fields[minimum_length(7)], int is_local) {
if (mn < 0)
mn += 12;
if (ym < -271821 || ym > 275760)
return NAN;
return JS_FLOAT64_NAN;

yi = ym;
mi = mn;
Expand Down Expand Up @@ -50389,7 +50389,7 @@ static double set_date_fields(double fields[minimum_length(7)], int is_local) {
/* emulate 21.4.1.16 MakeDate ( day, time ) */
tv = (temp = day * 86400000) + time; /* prevent generation of FMA */
if (!isfinite(tv))
return NAN;
return JS_FLOAT64_NAN;

/* adjust for local time and clip */
if (is_local) {
Expand Down Expand Up @@ -50428,7 +50428,7 @@ static JSValue set_date_field(JSContext *ctx, JSValue this_val,
int res, first_field, end_field, is_local, i, n;
double d, a;

d = NAN;
d = JS_FLOAT64_NAN;
first_field = (magic >> 8) & 0x0F;
end_field = (magic >> 4) & 0x0F;
is_local = magic & 0x0F;
Expand Down Expand Up @@ -50628,7 +50628,7 @@ static JSValue js_date_constructor(JSContext *ctx, JSValue new_target,
if (i == 0 && fields[0] >= 0 && fields[0] < 100)
fields[0] += 1900;
}
val = (i == n) ? set_date_fields(fields, 1) : NAN;
val = (i == n) ? set_date_fields(fields, 1) : JS_FLOAT64_NAN;
}
has_val:
rv = js_create_from_ctor(ctx, new_target, JS_CLASS_DATE);
Expand Down
6 changes: 6 additions & 0 deletions quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#ifndef QUICKJS_H
#define QUICKJS_H

/* In Windows SDK >= 26100 NAN is not a constant expression.
* See: https://github.com/quickjs-ng/quickjs/issues/622 */
#if defined(_MSC_VER)
#define _UCRT_NOISY_NAN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be doing that in quickjs.h. That affects embedders too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... your approach is better anyway, dropping this one.

#endif

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Expand Down
Loading