Closed elenakrittik closed 6 months ago
I'm pretty sure this is also a requirement for the GDCLASS()
macro in Godot itself. Since one of the design goals of godot-cpp is to be as API compatible as possible with modules in Godot, this would need to be changed in Godot first.
Does godot-cpp somehow re-use the macro definition from Godot, or does godot-cpp copy it? If the latter, may it be possible to refactor GDCLASS(ExposedName, Ancestor)
into something like GDCLASS_CUSTOM(Cppname, ExposedName, Ancestor)
and make GDCLASS(ExposedName, Ancestor) = GDCLASS_CUSTOM(ExposedName, ExposedName, Ancestor)
to preserve compatibility?
I don't really see why this would be useful? Why would you want to register it in this way? You have namespaces in godot-cpp so it's not a matter of name collision, we register the core binds by their names in that way, see core/core_binds.h
in the engine
To me this just adds complexity and fragility to the build system without adding any needed feature
Oh, namespaces, right.. My case was indeed to avoid name collisions, but i forgot about namespaces. Not a day-to-day C++ user as you can see 😅 Case closed, thanks!
Godot version
4.1.3-stable
godot-cpp version
The 4.1 branch
System information
Godot v4.1.3.stable - Windows 10.0.19045 - Vulkan (Compatibility) - NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.5123) - AMD Ryzen 7 5800X 8-Core Processor (8 Threads)
Issue description
If in the example from docs i do the following change:
The code stops compiling with the following log:
Steps to reproduce
Please see below
Minimal reproduction project
Clone
https://github.com/elenakrittik/gcppnames
and compile as usual.