This recent reddit post outlined some problems with header only libraries in c.
TLDR: Static functions will get omitted in every translation unit separately.
I still want to maintain the header only part though, especially for random.h, as splitting it up would break the literate programming style.
Ideally I'd use a hybrid stb style, where the longer functions, like most the distributions, are only implemented if
RANDOM_H_IMPLEMENTATION is defined and all the other smaller functions are still
This would either require a header of forward declarations, which could be merged with the
API overview chapter, but this would require about tree to four time more lines for the chapter.
RANDOM_H_IMPLEMENTATION guard could also be used on a per function/chapter basis. If I choose this solution I'll probably also remove some
*_AVAILABLE guards that check for
uintN_t and the floating point format and combine the checks into one that does
#error if the features aren't available.