-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uint64_t
mapped to nuint
on Linux (but ulong
on Windows)
#574
Comments
Notably it's actually quite a bit more complicated than this. For example, I expect the reason the generation is happening this way comes down to the underlying header likely doing (possibly through several intermediate typedefs, as is typical on Linux) The reason this breaks the heuristics is because it is "technically incorrect" according to the official ABI specification and breaks certain considerations that may exist for languages like C++ (specifically around overload resolution and the like). As per the
Thus, for x86 and x64 computers a typedef "should" be using This consideration becomes very important in order to allow overloading and differentiating between ClangSharp could potentially add a built-in hook to intercept |
Thanks @tannergooding for the detailed explenation. On clang on Linux, typedef __INT64_TYPE__ int64_t; and the long unsigned int as determined like this:
So that leaves the option of using I would like to ask you to consider adding a default remapping for this type, since I believe |
Consider the following file:
The following code is generated on Windows (via
clangsharppinvokegenerator -f .\graphics.h -n FreeRDP3 -o graphics.cs
):whereas on Linux, the following code is generated (via
ClangSharpPInvokeGenerator -f ./graphics.h -I /usr/lib/clang/17/include -n FreeRDP3 -o graphics.cs
):The Linux mapping to
nuint
is incorrect, sinceuint64_t
is, by definition, 64-bits wide and architecture-independent.The text was updated successfully, but these errors were encountered: