www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - importC reflection bugs

reply Dakota <dakota gmail.com> writes:
I want to use importC reflection c header then generate D 
interface.

one problem I can not workaround is to determine `size_t` 
`ptrdiff_t` `uintptr_t`, they become `ulong`, `long`, `ulong`.


I need a method to let the D CTFE know the imported C type 
original type( `size_t` but not `ulong`).  Is this possible?
Feb 26
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 2/26/2024 6:07 AM, Dakota wrote:
 I want to use importC reflection c header then generate D interface.
 
 one problem I can not workaround is to determine `size_t` `ptrdiff_t` 
 `uintptr_t`, they become `ulong`, `long`, `ulong`.
 
 
 I need a method to let the D CTFE know the imported C type original type( 
 `size_t` but not `ulong`).  Is this possible?
Currently there is not a way to do that. ImportC eagerly resolves typedefs.
Feb 26
parent Dakota <dakota gmail.com> writes:
On Monday, 26 February 2024 at 17:10:13 UTC, Walter Bright wrote:
 On 2/26/2024 6:07 AM, Dakota wrote:
 I want to use importC reflection c header then generate D 
 interface.
 
 one problem I can not workaround is to determine `size_t` 
 `ptrdiff_t` `uintptr_t`, they become `ulong`, `long`, `ulong`.
 
 
 I need a method to let the D CTFE know the imported C type 
 original type( `size_t` but not `ulong`).  Is this possible?
Currently there is not a way to do that. ImportC eagerly resolves typedefs.
Right now I plan to fix it by hand, can we add a feature enhancement for this case?
Feb 27