-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
973: Make ptrcalls opt-in r=chitoyuu a=chitoyuu This implements cuddlefishie's suggestion in #814, but with the semantics reversed to better conform with Cargo's additive combination of features. - Added the new feature flag `ptrcall`, which enables performant API calls at the cost of forward binary compatibility with the engine. - Added tests with and without the feature to the full CI suite. I believe the current semantics to be better, since by making the safer option the default, it helps reduce the surprise factor when someone tries to use the crate with a supposedly compatible version of Godot. Different opinions are welcome. Note that this only addresses binary compatibility -- #814 is also in a large part an API problem. Co-authored-by: Chitose Yuuzaki <[email protected]>
- Loading branch information
Showing
12 changed files
with
110 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ rust-version = "1.63" | |
|
||
[features] | ||
debug = [] | ||
ptrcall = [] | ||
custom-godot = ["which"] | ||
|
||
[dependencies] | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#![allow(unused_variables)] | ||
|
||
#[cfg(feature = "ptrcall")] | ||
use libc; | ||
|
||
use libc::c_char; | ||
use std::mem; | ||
use std::ptr; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
#![allow(unused_variables)] | ||
|
||
#[cfg(feature = "ptrcall")] | ||
use gdnative_core::*; | ||
#[cfg(feature = "ptrcall")] | ||
use libc; | ||
|
||
use std::ptr; | ||
|
||
use gdnative_core::core_types::*; | ||
use gdnative_core::private::get_api; | ||
use gdnative_core::sys; | ||
use gdnative_core::*; | ||
|
||
include!(concat!(env!("OUT_DIR"), "/icalls.rs")); |
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