floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
7.12k stars 501 forks source link

[WIP] Add support for C3 to bindgen #1148

Open radekm opened 2 weeks ago

radekm commented 2 weeks ago

I thought bindgen support for C3 language could be useful, so I created this PR.

Unfortunately I haven't yet ported examples to C3 and have tested it only on macOS arm64.

Generated code can be browsed in my repository https://github.com/radekm/sokol-c3/

floooh commented 2 weeks ago

Looks like there's a python error in gen_c3.py:

https://github.com/floooh/sokol/actions/runs/11796284494/job/32872697466?pr=1148#step:9:9

radekm commented 2 weeks ago

Oh my, you're right, I somehow managed to use Python 3.12 feature which doesn't work in older Pythons (specifically using single quotes inside single-quoted f-string).

radekm commented 2 weeks ago

I have fixed CI (at least in my repo) by adding checkout of radekm/sokol-c3 into .github/workflows/gen_bindings.yml.

floooh commented 2 weeks ago

Oki, before merging C3 support, I'd like to get to a similar state as https://github.com/floooh/sokol-zig, e.g. a repository for the bindings, at least a handful examples ported, and an easy way to build the examples.

Should I create a repo under floooh/sokol-c3, and you could populate that?

radekm commented 2 weeks ago

Should I create a repo under floooh/sokol-c3, and you could populate that?

Sounds great! Yes, please create the repo.

floooh commented 2 weeks ago

Ok see: https://github.com/floooh/sokol-c3

I added you as collaborator so you can push directly (I think Github will send you an invite email). Later we should probably both work through PRs instead of committing directly to main.

I also added your name to the LICENSE file.

Once everything is setup I will add the code to the sokol CI pipeline to automatically update and push changes.