-
Notifications
You must be signed in to change notification settings - Fork 42
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
Windows build #327
Windows build #327
Conversation
Fixes warning: SET_METHOD redefined
Fixes MSVC Error C2131
At some point something like https://stackoverflow.com/questions/4226308/msvc-equivalent-of-attribute-warn-unused-result/22759336#22759336 should be used
Fixes gi.cc(373): error C3861: 'Export': identifier not found On Windows, for unclear reason the Nan namespace is lost for NAN_EXPORT(exports, RegisterClass)
Fixes segfault on Windows
Amazing work 😮 I have limited time these days but ping me when it's ready, I'll do a quick review and as long as the tests are passing for the existing OSes I'm ok with merging it. |
Fixes some segfaults on Windows, like const val = new GObject.Value() val.init(GObject.TYPE_STRING) <- crash
Fixes some crases on Windows. Fixes 5 tests
Fixes 1 test on Windows
GType is gsize is 8 bytes gulong is 8 bytes on Linux and 4 bytes Windows Fixes some segfaults on Windows Fixes 3 tests on Windows
Number.MAX_SAFE_INTEGER is 8 bytes, but vInt is gulong 4 bytes on Windows and 8 bytes on Linux
Fixes 1 test on Windows
See comment in code
@romgrk At this point all the tests pass on Linux and the majority of tests pass on Windows. The two skipped tests callback.js and signal__non-introspected.js (both Gst) pass locally on my machine, but seems to crash in CI. Since Gst doesn't interest me I'm not going to look into them. Also I disabled one test inside conversion__array.js introduced in #313, since it crashes somewhere inside node. See comment in code. MacOS build still fails #326, so no idea if my changes somehow affected it. |
I've started the test suite, let's see what passes. Overall LGTM, I'm ok merging as it is. Some windows support is better than no windows support. One thing though, for the node-gtk/src/modules/cairo/generator.js Lines 524 to 536 in ab813bb
|
Will do. Seems like I found the cause of Will change, test and give you know. |
On Windows g_free memory allocated with malloc/calloc crashes
@romgrk Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but LGTM. If you're not sure about the macos stuff try to leave it untouched.
src/function.cc
Outdated
@@ -448,16 +446,17 @@ Local<Value> FunctionCall ( | |||
* Third, make the actual ffi_call | |||
*/ | |||
|
|||
void *ffi_args[func->n_total_args]; | |||
void **ffi_args = new void*[func->n_total_args](); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@romgrk Done |
Good, nice work. Not sure I would have got around to doing the windows support by myself, so thanks a lot :) |
Great! Hopefully the project will start gaining more traction! |
Yeah, my dream as always been to have a clean & simple native alternative to electron. |
This PR makes it possible to build and run on Windows using Node.js 12, see GitHub workflow for Windows.
At this point the next examples run successfully:
examples/hello-gtk.js
examples/drawing-area.js
examples/builder-auto-connect-signals.js
examples/builder.js
examples/entry.js
Closes #107