GCC [0], Clang [1] and others [2] have supported for compiled headers. Cmake also has support for precompiled headers [3].
I would say both the tool and architecture to do that is well supported.
[0] https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
[1] https://clang.llvm.org/docs/PCHInternals.html
[2] https://www.qnx.com/developers/docs/6.3.2/neutrino/utilities... (-pch flag)
[3] https://cmake.org/cmake/help/latest/command/target_precompil...
says who? care to elaborate?
Not knocking the overall effort here, but yes, "header only" libs are definitely an anti-pattern in real world C. I assume the author considers it a curiosity, a novelty, or something that would only be used in very limited circumstances that make such a design an advantage.
This can be avoided by being careful to only define HTTP_BODY after including httpserver.h, but avoiding this type of thing to worry about is the entire point of interface/implementation separation.
What you are talking about is not an issue in practice.
// httpserverlib.c
#define HTTPSERVER_IMPL
#include "httpserver.h"
// TODO: look up definition of "compilation unit"Even windows.h redefines min and max - blaming single file libraries is ridiculous.
Using a single .c file that includes the file and defines the IMPL symbol would negate what you are saying anyway and in fact is a common way to use them.
Ok, well we're obviously arguing semantics at this point, then, because in my opinion, moving the IMPL definition into a single .c file doesn't negate the complaint about single-header libraries, it makes it no longer a single-header library. :D
It is soon 2020, there is no reasons to use C in new code. Because of security and also convenience.
Maybe it is a nice mental exercise (also try brainfuck and malbolge), but not something for production.