Is importC ready?

bachmeier no at spam.net
Thu Nov 11 22:07:22 UTC 2021


On Thursday, 11 November 2021 at 18:26:43 UTC, Ola Fosheim 
Grøstad wrote:
> On Thursday, 11 November 2021 at 17:37:37 UTC, bachmeier wrote:
>> Isn't `#ifndef` handled by the preprocessor? The `__restrict` 
>> problem I encountered is in the context of restricted pointers 
>> `*__restrict` that remained after preprocessing the file.
>
> Yes, everything with a ```#```-prefix is related to the 
> preprocessor. So you would not want the compiler to add 
> ```#define```, but instead handle ```__keyword``` based on the 
> emulated compiler target. But ```_Float128``` cannot be dealt 
> with this way since you *want* errors to reported…

My earlier thought was that DMD could add those statements to the 
C file, call the preprocessor, and then do the compilation. But 
even if there's a desire to avoid involvement with the 
preprocessor call, DMD could still change *__restrict to 
*restrict and some of the other fixes. It's already identifying 
those parts of the code so it can ignore them.


More information about the Digitalmars-d mailing list