Skip to content

Commit 9ca2b40

Browse files
bors[bot]Bromeon
andauthored
Merge #954
954: Import symbols used in version check (through macro) r=Bromeon a=Bromeon This fixes an issue for users without `use gdnative::prelude::*`, which could run into an error regarding symbols not found (e.g. Variant). bors try Co-authored-by: Jan Haller <[email protected]>
2 parents 8ed2e11 + 443901d commit 9ca2b40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gdnative-core/src/init/macros.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ macro_rules! godot_nativescript_init {
3838
// Compatibility warning if using in-house Godot version (not applicable for custom ones)
3939
#[cfg(not(feature = "custom-godot"))]
4040
{
41+
use $crate::core_types::Variant;
42+
4143
let engine = gdnative::api::Engine::godot_singleton();
4244
let info = engine.get_version_info();
4345

4446
if info.get("major").expect("major version") != Variant::new(3)
4547
|| info.get("minor").expect("minor version") != Variant::new(5)
4648
|| info.get("patch").expect("patch version") < Variant::new(1) {
4749
let string = info.get("string").expect("version str").to::<String>().expect("version str type");
48-
gdnative::log::godot_warn!(
50+
$crate::log::godot_warn!(
4951
"This godot-rust version is only compatible with Godot >= 3.5.1 and < 3.6; detected version {}.\n\
5052
GDNative mismatches may lead to subtle bugs, undefined behavior or crashes at runtime.\n\
5153
Apply the 'custom-godot' feature if you want to use current godot-rust with another Godot engine version.",

0 commit comments

Comments
 (0)