Would appreciate some help porting Q3VM to D (mainly C macros and type conversions)

Mark Bauermeister bauermeistermarkusdev at gmail.com
Tue Oct 15 17:37:03 UTC 2024


On Tuesday, 15 October 2024 at 16:05:48 UTC, Lance Bachmeier 
wrote:
> On Tuesday, 15 October 2024 at 13:30:03 UTC, Mark Bauermeister 
> wrote:
>> On Tuesday, 15 October 2024 at 12:27:42 UTC, barbosso wrote:
>>> Are you heard of https://github.com/dkorpel/ctod ?
>>
>> I actually used CTOD for part of the translation but it 
>> wouldn't translate the macros correctly. It turned them into 
>> weird string mixins.
>
> It's not as well known, but ImportC also converts C code to D: 
> https://dlang.org/spec/importc.html#ctod It needs the -inline 
> switch to output function bodies. The last time I used it, 
> there were problems with generation of duplicate items, but it 
> was able to handle most anything I threw at it. Would be worth 
> a try.

Thanks! That helped me figure out some more macros.

Now if only I could figure out how to resolve "variable 
`codeImage` cannot be read at compile time". That's the last 
thing neither of those automation solutions can help me with.


More information about the Digitalmars-d-learn mailing list