((((sandro.net))))

terça-feira, 18 de fevereiro de 2025

Show HN: Generic and variadic printing library in C https://ift.tt/4LvqW8B

Show HN: Generic and variadic printing library in C I was making a printf wrapper with some extra features when I thought "hey, now that C has _Generic, is there any way to combine that with varargs?". The closest solution I found online was this: https://ift.tt/X2LwNfW Which works, but only under GCC (since it uses an extension instead of _Generic) and its not very robust in general. So, I rolled my own, with a different macro hack and I think it came out reasonably well. Its not documented yet, because I'm unsure about the interface, but extending it with user structs is also possible without editing the header. (Example in 'example-user-type.c'.) https://ift.tt/nzdaQCL February 17, 2025 at 06:54PM

Nenhum comentário:

DJ Sandro

http://sandroxbox.listen2myradio.com