ImportC now supports function-like macros

Walter Bright newshound2 at digitalmars.com
Mon Mar 4 02:22:51 UTC 2024


On 3/2/2024 7:05 PM, Jonathan M Davis wrote:
> Honestly, given C's semanticts for const, I'm tempted to argue that it isn't
> even correct to treat anything as const when passing it to extern(C)
> functions. Ultimately, it's an @system thing, because D's type system
> guarantees aren't in place, but fundamentally, if you pass a const pointer
> to C from D, you're not getting any actual promises about it - to the point
> that you're effectively casting it to mutable when passing it.

Hence my suggestion of:

     #define const

when having difficulties with non-transitive const!



More information about the Digitalmars-d mailing list