Re: importC with struct name and function conflict

2024-08-03 Thread Dennis via Digitalmars-d-learn
On Saturday, 3 August 2024 at 05:10:37 UTC, Dakota wrote: How can I get the function and type from importC? is there a auto rename mechanism ? The most pragmatic workaround is to add a typedef to the C code: ```C int S; struct S { int a, b; }; typedef struct S S_t;// add this typedef ```

Re: Get compile time string of dmd command line options "-os" & "-target"

2024-08-03 Thread Dennis via Digitalmars-d-learn
On Thursday, 1 August 2024 at 04:00:08 UTC, An Pham wrote: pragma(msg, os.stringof...?); pragma(msg, target.stringof...?); There's no built-in way, but you can define it yourself in a helper module: ```D version(Windows) enum os = "windows"; else version(AArch64) enum os = "aarch64";

Re: Get compile time string of dmd command line options "-os" & "-target"

2024-08-03 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 3 August 2024 at 12:15:46 UTC, Dennis wrote: On Thursday, 1 August 2024 at 04:00:08 UTC, An Pham wrote: pragma(msg, os.stringof...?); pragma(msg, target.stringof...?); There's no built-in way, but you can define it yourself in a helper module: ```D version(Windows) enum os