Generic data structures in C

I've decided to explore the strategies that will allow us to write generic code in C. By generic features I mean similitudes with C++ templates, or better, with Java/C# Generics . In order to prove that generic programming can be achieved in plain C, we will write an implementation of a generic stack data structure by following the two major approaches: using C macros to generate specific code (and some of the advanced features, x macros, macro concatenation, macro stringification, macro arguments) or using the void pointer (void*) as the good old container that will hide the specificity of a certain type, but will allow casting. The second approach is the one used in GLib.