On Friday, 12 January 2024 at 11:06:39 UTC, Bkoie wrote:
On Thursday, 11 January 2024 at 15:18:08 UTC, Sergey wrote:
On Wednesday, 10 January 2024 at 23:36:33 UTC, JN wrote:
I would like to use ImportC to automatically import a C
header into my D project.
It was already done. Use it
https://
On Thursday, 11 January 2024 at 15:18:08 UTC, Sergey wrote:
On Wednesday, 10 January 2024 at 23:36:33 UTC, JN wrote:
I would like to use ImportC to automatically import a C header
into my D project.
It was already done. Use it
https://code.dlang.org/packages/wgpu-d
Don't reinvent the wheel :
You need to use a .c file that include it
--- webgpu.c
```c
#include "webgpu.h"
```
--- app.d
```d
import std.stdio;
import webgpu;
void main()
{
writeln(WGPUBlendFactor_Dst);
}
```
result:
```
$ dmd -run app.d webgpu.c
WGPUBlendFactor_Dst
```
On Wednesday, 10 January 2024 at 23:36:33 UTC, JN wrote:
I would like to use ImportC to automatically import a C header
into my D project.
It was already done. Use it https://code.dlang.org/packages/wgpu-d
Don't reinvent the wheel :)
I would like to use ImportC to automatically import a C header
into my D project. I've been using Dstep so far which works ok,
but requires some manual fixes to get the resulting D file to
compare and it doesn't let me to just drop the C header file.
I created a fresh dub project to try. I try