What was the advantage of splitting out the platform-related stuff into its own file? What was the advantage of making handmade_platform.h pure C?
The idea is that we always compile the game code as C++ into a shared library (.dll on Windows, .so on linux, .dylib on Mac (I think) ) and the platform executable will load this code. The communication between the two part (executable and library) is a tiny part of the code and by putting that in it's own file we defined a clear "interface" for what needs to be supported by the platform.
I'm not 100% certain about the pure C part as I've never called C or C++ code from another language. But my understanding is that, C++ function name mangling
isn't the same on every compiler, while the C one is. And according to the previous wikipedia article, some other language compilers can "understand" the C name mangling and so it's easy to call C functions from those languages. Maybe someone more knowledgeable can confirm or infirm that ?