On Thursday, 12 May 2022 at 21:36:40 UTC, Walter Bright wrote:
>On 5/12/2022 11:10 AM, H. S. Teoh wrote:
>There's also macro functions that
sometimes crop up in complex C headers. Those are hard to automatically
translate; some cases may need inline functions, some involve
token-pasting and may not be translatable without human intervention.
All true. If a .h file uses preprocessor for metaprogramming, there's no way to make that work in D.
It should be possible most of the time, as macros in most cases expands to counterparts in the C grammar. You also have to support _Generic. It is by and large a matter of aligning D semantics with C, and that is not a far fetched goal.
If such things are not supported then the utility is so limited that it might be better to drop import-C. People generally dont want to deal with 90% solutions (only the most hardcore users want that).