ctypeslib icon indicating copy to clipboard operation
ctypeslib copied to clipboard

void* and char* conversion

Open JulianS-Uni opened this issue 6 years ago • 3 comments

When doing typedefs in C like those:

typedef char*                    PCHAR;
typedef void*                    PVOID;

clang2py creates following ctypes:

PCHAR = POINTER_T(ctypes.c_char)
PVOID = POINTER_T(None)

shouldn't it be this:

PCHAR = ctypes.c_char_p
PVOID = ctypes.c_void_p

JulianS-Uni avatar Dec 01 '19 14:12 JulianS-Uni

In short, it's due to trying to handle cross-architecture variable pointer size

trolldbois avatar Feb 17 '21 19:02 trolldbois

Potential TODO also: if no -target, just remove the POINTER_T template from generation

trolldbois avatar Feb 17 '21 19:02 trolldbois

Improved a bit in HEAD. Still work to do

trolldbois avatar Feb 23 '21 05:02 trolldbois