Improve Windows support #368
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi!368
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "upcall-w64"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR fixes issues that were discovered during a test on Windows.
All of the fixes involve
long(andunsigned long) values, which are sized as 32-bit on (x86-64) Windows and 64-bit on (x86-64) Linux and macOS.(See this wikipedia overview, specifically the difference between LLP64 and LP64, for details.) Java-GI uses 64-bit values (
ValueLayout.JAVA_LONG) on Linux and macOS, and 32-bit values (ValueLayout.JAVA_INT) on Windows, whenever alongorunsigned longis encountered.Most of this was already implemented previously, but it contained several bugs, that have now been fixed. Furthermore, callback functions with
long/unsigned longparameters or return values now also work correctly (via aupcall_w64()function that is generated in addition to the already existingupcall()). This also works for method overrides.On the Java side, all
longandunsigned longparameter- and return-types are represented asint, which is the largest common denominator for all three supported platforms.This PR shouldn't introduce any breaking changes in the API.