You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling a GDExtension to Windows from Linux - or on some Windows installs - types such as long are not considered the correct size.
Ex: using int64_t instead of long will compile but just using long won't compile for Windows builds.
Steps to reproduce
Create a simple GDExtension using long as a variable type in a function (either a return type or a parameter)
Attempt to compile to Windows via scons arch=x86_64 platform=windows target=template_debug
A large amount of errors related to method binding will occur.
Minimal reproduction project
Follow "Steps to reproduce"
The text was updated successfully, but these errors were encountered:
Using long as an argument on a bound method actually seems to work for me on Linux with GCC 11.4. I'm a little surprised, though! We don't provide a version of GetTypeInfo<T> for long, so I was expecting to see an error.
However, I tried on MSVC on Windows, and did manage to get an error along the lines I was expecting.
In any case, personally, I don't think we should support binding functions with arguments or return types of long or short or any of the related variants. C++ doesn't give a fixed size for those types, they are all defined as "having at least X bits" which means the compiler could chose to use a larger size:
Would it not be ideal to alias the types to the fixed width versions?
Or maybe define them to something so they raise a much clearer error that says to use the fixed width versions?
Edit: Maybe also define the int types like Rust (i8, i16, i32, i64, u8, u16, u32, u64) for optional use?
Or maybe define them to something so they raise a much clearer error that says to use the fixed width versions?
This would be nice, although, I'm not sure how to actually do it.
I'm not too crazy about the other ideas. I don't want to try to magically alias types or provide new types, when we've already got all the ones we need from standard C++. And, in either case, we'd need to make those changes in Godot first, since godot-cpp tries to mimick Godot's internal APIs.
Godot version
v4.2.2.stable.mono.official [15073afe3]
godot-cpp version
4.2.2
System information
Godot v4.2.2.stable.mono - Manjaro Linux ZEN SMP PREEMPT_DYNAMIC - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT () - AMD Ryzen 7 3800X 8-Core Processor (16 Threads)
Issue description
When compiling a GDExtension to Windows from Linux - or on some Windows installs - types such as
long
are not considered the correct size.Ex: using
int64_t
instead oflong
will compile but just usinglong
won't compile for Windows builds.Steps to reproduce
Create a simple GDExtension using
long
as a variable type in a function (either a return type or a parameter)Attempt to compile to Windows via
scons arch=x86_64 platform=windows target=template_debug
A large amount of errors related to method binding will occur.
Minimal reproduction project
Follow "Steps to reproduce"
The text was updated successfully, but these errors were encountered: