@@ -111,21 +111,21 @@ class ClassDB {
111111 static void _register_class (bool p_virtual = false , bool p_exposed = true , bool p_runtime = false );
112112
113113 template <typename T>
114- #if GODOT_VERSION_MINOR >= 4
114+ #if GODOT_VERSION >= 0x040400
115115 static GDExtensionObjectPtr _create_instance_func (void *data, GDExtensionBool p_notify_postinitialize) {
116116#else
117117 static GDExtensionObjectPtr _create_instance_func (void *data) {
118- #endif // GODOT_VERSION_MINOR >= 4
118+ #endif // GODOT_VERSION >= 0x040400
119119 if constexpr (!std::is_abstract_v<T>) {
120120 Wrapped::_set_construct_info<T>();
121- #if GODOT_VERSION_MINOR >= 4
121+ #if GODOT_VERSION >= 0x040400
122122 T *new_object = new (" " , " " ) T;
123123 if (p_notify_postinitialize) {
124124 new_object->_postinitialize ();
125125 }
126126#else
127127 T *new_object = memnew (T);
128- #endif // GODOT_VERSION_MINOR >= 4
128+ #endif // GODOT_VERSION >= 0x040400
129129 return new_object->_owner ;
130130 } else {
131131 return nullptr ;
@@ -203,11 +203,11 @@ class ClassDB {
203203
204204 static MethodBind *get_method (const StringName &p_class, const StringName &p_method);
205205
206- #if GODOT_VERSION_MINOR >= 4
206+ #if GODOT_VERSION >= 0x040400
207207 static GDExtensionClassCallVirtual get_virtual_func (void *p_userdata, GDExtensionConstStringNamePtr p_name, uint32_t p_hash);
208208#else
209209 static GDExtensionClassCallVirtual get_virtual_func (void *p_userdata, GDExtensionConstStringNamePtr p_name);
210- #endif // GODOT_VERSION_MINOR >= 4
210+ #endif // GODOT_VERSION >= 0x040400
211211
212212 static const GDExtensionInstanceBindingCallbacks *get_instance_binding_callbacks (const StringName &p_class);
213213
@@ -255,9 +255,9 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
255255 class_register_order.push_back (cl.name );
256256
257257 // Register this class with Godot
258- #if GODOT_VERSION_MINOR >= 5
258+ #if GODOT_VERSION >= 0x040500
259259 GDExtensionClassCreationInfo5 class_info = {
260- #elif GODOT_VERSION_MINOR >= 4
260+ #elif GODOT_VERSION >= 0x040400
261261 GDExtensionClassCreationInfo4 class_info = {
262262#else
263263 GDExtensionClassCreationInfo3 class_info = {
@@ -266,9 +266,9 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
266266 is_abstract, // GDExtensionBool is_abstract;
267267 p_exposed, // GDExtensionBool is_exposed;
268268 p_runtime, // GDExtensionBool is_runtime;
269- #if GODOT_VERSION_MINOR >= 4
269+ #if GODOT_VERSION >= 0x040400
270270 nullptr , // GDExtensionConstStringPtr icon_path;
271- #endif // GODOT_VERSION_MINOR >= 4
271+ #endif // GODOT_VERSION >= 0x040400
272272 T::set_bind, // GDExtensionClassSet set_func;
273273 T::get_bind, // GDExtensionClassGet get_func;
274274 T::has_get_property_list () ? T::get_property_list_bind : nullptr , // GDExtensionClassGetPropertyList get_property_list_func;
@@ -286,15 +286,15 @@ void ClassDB::_register_class(bool p_virtual, bool p_exposed, bool p_runtime) {
286286 &ClassDB::get_virtual_func, // GDExtensionClassGetVirtual get_virtual_func;
287287 nullptr , // GDExtensionClassGetVirtualCallData get_virtual_call_data_func;
288288 nullptr , // GDExtensionClassCallVirtualWithData call_virtual_func;
289- #if GODOT_VERSION_MINOR <= 3
289+ #if GODOT_VERSION <= 0x040300
290290 nullptr , // GDExtensionClassGetRID get_rid;
291- #endif // GODOT_VERSION_MINOR <= 3
291+ #endif // GODOT_VERSION <= 0x040300
292292 (void *)&T::get_class_static (), // void *class_userdata;
293293 };
294294
295- #if GODOT_VERSION_MINOR >= 5
295+ #if GODOT_VERSION >= 0x040500
296296 ::godot::gdextension_interface::classdb_register_extension_class5 (::godot::gdextension_interface::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info);
297- #elif GODOT_VERSION_MINOR >= 4
297+ #elif GODOT_VERSION >= 0x040400
298298 ::godot::gdextension_interface::classdb_register_extension_class4 (::godot::gdextension_interface::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info);
299299#else
300300 ::godot::gdextension_interface::classdb_register_extension_class3 (::godot::gdextension_interface::library, cl.name._native_ptr(), cl.parent_name._native_ptr(), &class_info);
0 commit comments