Skip to content
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

Improve cross platform comparability for quickjs. #49

Closed
wants to merge 13 commits into from

Conversation

lygstate
Copy link

@lygstate lygstate commented Feb 1, 2021

Split quickjs-port.h out
Add msvc support.
Add cmake building system.

Signed-off-by: Yonggang Luo [email protected]
Signed-off-by: Robikz [email protected]

@theduke
Copy link

theduke commented Feb 4, 2021

I'd love to see this upstream, but FYI: you have to send your patch to the mailing list here: https://www.freelists.org/list/quickjs-devel.

PRs are not accepted.

@theduke
Copy link

theduke commented Feb 4, 2021

Ah, I see you already did so.

@theduke
Copy link

theduke commented Feb 4, 2021

And I also see you added a CMake config.

I'm doubtful that would be accepted.

@lygstate lygstate force-pushed the msvc branch 7 times, most recently from 9411890 to 1a921e5 Compare February 16, 2021 08:37
So we use a >> (LIMB_BITS - shift) instead, as a is 64 bit width.

Signed-off-by: Yonggang Luo <[email protected]>
[main] Building folder: quickjs
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/work/study/languages/typescript/quickjs/build/Release-win32-x86 --config Release --target all -- -j 34
[build] [1/5  20% :: 0.259] Building C object CMakeFiles\quickjs.dir\quickjs.c.obj
[build] FAILED: CMakeFiles/quickjs.dir/quickjs.c.obj
[build] C:\PROGRA~2\MICROS~1\2019\BUILDT~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x86\cl.exe  /nologo -DCONFIG_BIGNUM=\"1\" -DCONFIG_VERSION=\"2020-11-08\" -I. -I..\..\ /DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG -wd4244 -wd4996 -wd4018 -wd4146 -wd4013 -std:c11 /showIncludes /FoCMakeFiles\quickjs.dir\quickjs.c.obj /FdCMakeFiles\quickjs.dir\quickjs.pdb /FS -c ..\..\quickjs.c
[build] ..\..\quickjs.c(41704): error C2099: initializer is not a constant
[build] ninja: build stopped: subcommand failed.
[build] Build finished with exit code 1
using snprintf instead.

Signed-off-by: Yonggang Luo <[email protected]>
…out init.

Give it a init value

Signed-off-by: Yonggang Luo <[email protected]>
'type cast': cannot convert from 'JSValue' to 'JSValue'

JSValueConstCast are not necessary because there is no need of cast when
converting type from const void* to void*
@lygstate lygstate force-pushed the msvc branch 2 times, most recently from f72176c to 731f325 Compare February 16, 2021 13:39
test262/test/built-ins/Math/asinh/asinh-specialVals.js:11: Test262Error: Math.asinh should produce +0 for +0 Expected SameValue(«-Infinity», «Infinity») to be true
test262/test/built-ins/Math/asinh/asinh-specialVals.js:11: strict mode: Test262Error: Math.asinh should produce +0 for +0 Expected SameValue(«-Infinity», «Infinity») to be true
test262/test/built-ins/Math/atanh/atanh-specialVals.js:21: Test262Error: Math.atanh should produce -0 for -0 Expected SameValue(«Infinity», «-Infinity») to be true
test262/test/built-ins/Math/atanh/atanh-specialVals.js:21: strict mode: Test262Error: Math.atanh should produce -0 for -0 Expected SameValue(«Infinity», «-Infinity») to be true
@lygstate lygstate force-pushed the msvc branch 4 times, most recently from 8a88c72 to 4861160 Compare February 17, 2021 20:00
Move all platform related functions into quickjs-port.h and quickjs-port.c
Add full msvc support.

BOOL conflict with Windows.h, do not define it in header file, define it in c file directly

Now run-test262 pass all tests match unix platform after add atomic/thread support on win32 by using quickjs-port.h
win/stdatomic.h comes from https://github.com/cdschreiber/c11
win/dirent.h comes from https://github.com/tronkko/dirent
win/getopt.h comes from mingw

Now `make test2-update` passed all tests under msys2/mingw

Add worker support in qjs on win32

Fixes tests on win32 as much as possible

Signed-off-by: Yonggang Luo <[email protected]>
@knight666
Copy link

I've inadvertently done the same work in my own pull request... Needless to say that I fully endorse this one, as it seems to be cleaner and better tested!

@ramonGonzEdu
Copy link

FYI, you can get the patch file by adding .patch to a pull req, eg. https://github.com/bellard/quickjs/pull/49.patch

@bellard bellard closed this Mar 21, 2021
@lygstate lygstate deleted the msvc branch March 29, 2021 19:31
GerHobbelt pushed a commit to GerHobbelt/quickjs that referenced this pull request Oct 17, 2023
Implement vm.resolve(promiseLikeHandle)
TooTallNate pushed a commit to TooTallNate/quickjs that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants