-
Couldn't load subscription status.
- Fork 166
Closed
Description
In a lot of Windows API's, when a callback is passed to a function, usually the function pointer itself is declared as a function type, with a typedef into a function pointer. ClangSharp doesn't seem to like this, and generates a double function pointer instead, which is incorrect.
#pragma once
typedef
int
(__cdecl Callback)(
int Input
);
typedef Callback *CallbackHandler;
typedef struct Thing {
CallbackHandler CB;
} Thing;
This code should generate
namespace TestNS
{
public unsafe partial struct Thing
{
[NativeTypeName("CallbackHandler")]
public delegate* unmanaged[Cdecl]<int, int> CB;
}
}
But insteads generates as
namespace TestNS
{
public unsafe partial struct Thing
{
[NativeTypeName("CallbackHandler")]
public delegate* unmanaged[Cdecl]<int, int>* CB;
}
}
Which is incorrect because of the extra indirection on CB.
Metadata
Metadata
Assignees
Labels
No labels