Re: How to use ImportC to import WebGPU header

2024-01-12 Thread Sergey via Digitalmars-d-learn
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

Re: How to use ImportC to import WebGPU header

2024-01-12 Thread Bkoie via Digitalmars-d-learn
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

Re: How to use ImportC to import WebGPU header

2024-01-11 Thread ryuukk_ via Digitalmars-d-learn
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 ```

Re: How to use ImportC to import WebGPU header

2024-01-11 Thread Sergey via Digitalmars-d-learn
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 :)

How to use ImportC to import WebGPU header

2024-01-10 Thread JN via Digitalmars-d-learn
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

Re: How to use ImportC?

2022-03-18 Thread Leonardo via Digitalmars-d-learn
On Friday, 4 March 2022 at 17:17:17 UTC, MoonlightSentinel wrote: On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote: Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 ``` Please retry with the

Re: How to use ImportC?

2022-03-06 Thread dangbinghoo via Digitalmars-d-learn
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote: Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright [leonardo@leonardo-pc

Re: How to use ImportC?

2022-03-04 Thread bachmeier via Digitalmars-d-learn
On Friday, 4 March 2022 at 17:17:17 UTC, MoonlightSentinel wrote: On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote: Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 ``` Please retry with the

Re: How to use ImportC?

2022-03-04 Thread MoonlightSentinel via Digitalmars-d-learn
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote: Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 ``` Please retry with the [beta](https://dlang.org/download.html#dmd_beta) or [nightly

Re: How to use ImportC?

2022-03-03 Thread bachmeier via Digitalmars-d-learn
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote: Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright [leonardo@leonardo-pc

Re: How to use ImportC?

2022-03-03 Thread Leonardo via Digitalmars-d-learn
Thanks but not worked here. ``` [leonardo@leonardo-pc dimportc]$ dmd --version DMD64 D Compiler v2.098.1 Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright [leonardo@leonardo-pc dimportc]$ ls foo.c program.d [leonardo@leonardo-pc dimportc]$ cat

Re: How to use ImportC?

2022-03-03 Thread bachmeier via Digitalmars-d-learn
On Thursday, 3 March 2022 at 19:05:22 UTC, Leonardo wrote: I saw the new feature called ImportC, it's cool to be able to use C code/libraries, but I'm not much experience in C and didn't understand this incomplete documentation: https://dlang.org/spec/importc.html How to use ImportC? You

Re: How to use ImportC?

2022-03-03 Thread forkit via Digitalmars-d-learn
On Thursday, 3 March 2022 at 19:05:22 UTC, Leonardo wrote: I saw the new feature called ImportC, it's cool to be able to use C code/libraries, but I'm not much experience in C and didn't understand this incomplete documentation: https://dlang.org/spec/importc.html How to use ImportC? I

How to use ImportC?

2022-03-03 Thread Leonardo via Digitalmars-d-learn
I saw the new feature called ImportC, it's cool to be able to use C code/libraries, but I'm not much experience in C and didn't understand this incomplete documentation: https://dlang.org/spec/importc.html How to use ImportC?