Noob ImportC questions
John C.
example at example.com
Thu Feb 27 13:33:55 UTC 2025
On Thursday, 27 February 2025 at 12:48:19 UTC, Kapendev wrote:
> On Thursday, 27 February 2025 at 08:16:33 UTC, John C. wrote:
>> On Thursday, 27 February 2025 at 08:10:04 UTC, John C. wrote:
>> But this change was not helpful, same error occured. Does this
>> mean that ImportC cannot parse object literals?
>
> Seems like it has a hard time understanding structs. I tried
> something like `#define MY_COLOR struct Color {...}`, but got
> the same error.
I have found YouTube video about ImportC and Raylib, author
writes many constants to make ImportC parse colors successfully.
His raylib.c looked like following:
```
#include "../lib/raylib/include/raylib.h"
const Color lightgray = LIGHTGRAY;
const Color gray = GRAY;
const Color darkgray = DARKGRAY;
const Color yellow = YELLOW;
...
```
After applying this modification to raylib.c, all code I have
tested worked perfectly.
More information about the Digitalmars-d-learn
mailing list