-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle return type promotion in the high layer
As described in #66, the libffi library implicitly extends small integer types used as return types, both in calls and closure callbacks. This is not currently addressed by the existing code base. For the low and middle layers, the user can manually address this issue by using appropriate return types. However, for the high layer, the types are automatically determined, and are currently incorrect. This leads to problems (primarily) on big-endian platforms. This PR addresses the return type extension in the high layer by storing the extended type used by libffi as an associated type `RetType` in the `CType` trait, and using that type when performing calls or constructing closure callbacks. This implementation does not change the libffi-rs API, and should not add any significant run-time overhead.
- Loading branch information
Showing
4 changed files
with
60 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters