Re: importC error: can not find the #define ERR_INVALID -1

2024-08-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 3 August 2024 at 05:07:55 UTC, Dakota wrote: ```c #define ERR_SUCCESS 0 #define ERR_INVALID -1 // invalid argument ``` If the number >=0, it work. < 0 will not work. DMD64 D Compiler v2.110.0-beta.1 https://issues.dlang.org/show_bug.cgi?id=24639 -Steve

importC with struct name and function conflict

2024-08-02 Thread Dakota via Digitalmars-d-learn
```c struct type_name { int a; } int type_name(int a); ``` How can I get the function and type from importC? is there a auto rename mechanism ?

importC error: can not find the #define ERR_INVALID -1

2024-08-02 Thread Dakota via Digitalmars-d-learn
```c #define ERR_SUCCESS 0 #define ERR_INVALID -1 // invalid argument ``` If the number >=0, it work. < 0 will not work. DMD64 D Compiler v2.110.0-beta.1

Re: How to work with long paths on Windows?

2024-08-02 Thread James Carter via Digitalmars-d-learn
On Monday, 14 November 2022 at 18:45:40 UTC, Imperatorn wrote: On Monday, 14 November 2022 at 14:43:50 UTC, Preetpal wrote: On Monday, 14 November 2022 at 10:44:11 UTC, Imperatorn wrote: On Tuesday, 13 September 2022 at 19:54:15 UTC, Preetpal wrote: [...] Have you set longPathAware in the ap

Re: Any way to automatically convert structs on return?

2024-08-02 Thread Juraj via Digitalmars-d-learn
On Thursday, 1 August 2024 at 07:25:53 UTC, Emma wrote: ```d Option!int something() { return None(); // Error: cannot implicitly convert expression `None()` of type `None` to `Option!int` } ``` Not D per se, but you can check Adam D. Ruppe's current work. If I am not mistaken, the thing yo