ImportC and nothrow/@nogc?

Steven Schveighoffer schveiguy at gmail.com
Fri Aug 30 14:49:38 UTC 2024


On Friday, 30 August 2024 at 10:20:07 UTC, Atila Neves wrote:
> On Thursday, 29 August 2024 at 19:50:10 UTC, Steven 
> Schveighoffer wrote:
>> On Thursday, 29 August 2024 at 19:32:06 UTC, Stefan Koch wrote:
>>
>>> That requires modification of the C header.
>>> maybe using the attribute on the import is a better idea.
>>> Perhaps it is reasonable to have both, but I can imagine 
>>> people not wanting to change their headers.
>>
>> You can't import headers with importC. You have to import C 
>> files.
>>
>> It is already necessary to create shim C files.
>>
>> So in the shim, you set the attributes, and import the headers 
>> you need.
>
> Except you can't, because it's a C file, not D. What am I 
> missing?

 From the original message that Stefan responded to:

> Here is a pull request for a new ImportC pragma, which allows 
> to set `nothrow`, `@nogc` and `pure`:
> https://github.com/dlang/dmd/pull/16820

-Steve


More information about the Digitalmars-d mailing list