bflattened / bflat

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[zerolib] Binding to C standard library

opened this issue · comments

@lucabol You are currently working on it, aren't you? It seems you are writing the Pinvoke code manually. I suggest using automation tools. There are various of them on Github. I have no experience with them, though. The last time I seriously wrote C# code was in 2010, and as I recall, there were no such tools available. My C# skills are so rusted. What a shame of me!

https://github.com/dotnet/ClangSharp?tab=readme-ov-file#generating-bindings is one of the better tools for this. Takes a C header file and generates C# with p/invoke declarations.

https://github.com/dotnet/ClangSharp?tab=readme-ov-file#generating-bindings is one of the better tools for this. Takes a C header file and generates C# with p/invoke declarations.

Will the generated Pinvoke code compatible with zerolib? The limitations of Disabled runtime marshalling are many.

It seems @lucabol is doing a very minimal LibC stub. What I'm proposing here is a complete LibC wrapper.