News for hackers. Stuff that matters.

thisiswas

Re:Single_file_libs: List of single-file C/C++ libraries on Monday October 26, 2020 @08:17AM (#24895291)
stb actually went to extreme lengths on his SDL/GLFW-like library where he didn't even depend on windows.h, i.e he put just the structs and function(pointers) he needed into the header (under stbxxx_ prefixes), hardcoded magic numbers instead of windows.h's #defines, bootstrapped with __declspec(dllimport) GetProcAddress (and even that symbol can be omitted with some trickery, there is a way to get to kernel32.dll functions from any .exe)
Re:Single_file_libs: List of single-file C/C++ libraries on Monday October 26, 2020 @08:02AM (#24895178)
I find single file libs superior to typical package managers. What is more ergonomic than - download file, drop into your project, include and start coding, and I can use my favorite build system/way of setting up projects, no need to integrate anything.

Can trivially support multiple incompatible versions of the library, nothing needs to be fetched or resolved (once you've got the single file of course), can send and distribute it easily over any channel you want (web, email, free file host, google drive, your own website, etc).