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

Fix Windows API functions #643

Merged
merged 4 commits into from
Aug 5, 2024
Merged

Fix Windows API functions #643

merged 4 commits into from
Aug 5, 2024

Conversation

filmor
Copy link
Member

@filmor filmor commented Aug 5, 2024

When adding the newer functions, I messed up the order and missed one function, which breaks rustler-sys for all newer API versions on Windows. Other OS are not affected by this, as they link the symbols directly instead of getting passed a struct.

Making the rustler_sys functions extern "C" just ensures that they look the same, independent of the operation system.

When adding the newer functions, I messed up the order and missed one
function, which breaks rustler-sys for all newer API versions on
Windows. Other OS are not affected by this, as they link the symbols
directly instead of getting passed a struct.
@filmor
Copy link
Member Author

filmor commented Aug 5, 2024

@philss @josevalim This finally fixes the issues that we ran into with enif_term_type. The name was simply assigned the wrong function because when adding the newer API functions, I wasn't aware of the order-sensitivity :/

@filmor filmor mentioned this pull request Aug 5, 2024
@josevalim
Copy link
Contributor

@filmor hooray! How did you even find this one out? :D

@filmor
Copy link
Member Author

filmor commented Aug 5, 2024

While working on the dyncall support in #635, I got really strange errors on Windows when using enif_init_resource_type that referenced enif_term_type, and then I had a closer look how the API functions are referenced on Windows. :)

@filmor filmor merged commit f7ca63b into master Aug 5, 2024
46 checks passed
@filmor filmor deleted the fix-windows-api-funcs branch August 5, 2024 20:29
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.

2 participants