I've tried doing this for a few years and it just sucks ass. Just use c++ and templates if you need proper generic data structures. C is a defective language.
Or, in 2026, Rust (or Zig, I don't care).
Can't be all that defective if it underpins most of the technology in the world
I start to like my experimental macro containers: https://codeberg.org/uecker/noplate/
Examples: https://godbolt.org/z/hecqs78xs https://godbolt.org/z/YnrcjKrEn
Not perfect, but also not really inferior to C++ in my opinion.