3 ms·
Yeah but "externally compiled libraries are a pain so I'm going to put the entire source in a single header file because tarballs man, how do they work" is a he
by Avshalom 11y ago
Yeah but "externally compiled libraries are a pain so I'm going to put the entire source in a single header file because tarballs man, how do they work" is a hell of a non sequitur.
- IshKebab 11y agoTarballs don't really solve the problem as nicely as a single header file.
- mcguire 11y ago"Nicely"? It needs to abuse the preprocessor to avoid having multiple conflicting copies of the functions. The implementation mode requires to define the preprocessor macro NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.: #define NK_IMPLEMENTATION #include "nuklear.h"
- deleted 11y ago[deleted]
- SolarNet 11y agoThat's literally what the preprocessor is for. The C++ inline keyword basically has the same effect, and probably half (or more) of your headers "abuse" it for exactly this purpose.