3 ms·
It's an STB-style single-file library, which means the implementation is in a separate ifdef-block from the interface declarations, this allows to compile the i
by flohofwoe 6y ago
It's an STB-style single-file library, which means the implementation is in a separate ifdef-block from the interface declarations, this allows to compile the implementation in a different source file (which can be a C file) from the source files which use the library (which can be C++ files).
Here's for example such an "implementation source file" example (using stb_image.h):
https://github.com/floooh/sokol-samples/blob/master/libs/stb/stb_image.c https://github.com/floooh/sokol-samples/blob/master/libs/stb...
...or for a whole collection of related single-file libraries:
https://github.com/floooh/sokol-samples/blob/master/libs/sokol/sokol.c https://github.com/floooh/sokol-samples/blob/master/libs/sok...
- CyberRabbi 6y agoYes, my mistake. I assumed they retained some code in header mode intended for inlining but that was not correct.