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

cgen, dl: add windows dll support, fix (#20447) #20459

Merged
merged 2 commits into from Jan 10, 2024

Conversation

kbkpbot
Copy link
Contributor

@kbkpbot kbkpbot commented Jan 10, 2024

As Windows LoadLibrary/FreeLibrary do not support constructor/destructor, add vlib/dl_windows.c.v support a workaround.
Inside the dl.open(), call the _vinit_caller().
Inside the dl.close(), call the _vcleanup_caller().
This will build the v runtime environment for the DLL.

fix (#20447 )

@kbkpbot kbkpbot changed the title cgen, dl: add windows dll support cgen, dl: add windows dll support, fix (#20447) Jan 10, 2024
@kbkpbot
Copy link
Contributor Author

kbkpbot commented Jan 10, 2024

In cgen.v, shared object not install the use_segfault_handler, this should be done by the loader.
Also, shared object bypass the builtin_init().

Or these will cause tcc/windows fail with (0xC0000005) when exit().

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@spytheman spytheman merged commit fd269ca into vlang:master Jan 10, 2024
54 checks passed
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.

None yet

2 participants