CREATE-PROJECT: Various portability fixes for Mac OS X Leopard and other older systems #2751
Here's a set of changes I had to make so that
This is maybe useless (although the one for
Tested on Leopard and Mojave.
Maybe move the override workaround to create_project.h so that it's applied everywhere, otherwise using override in the future in a different file will break this again.
These changes look good to me, thanks! I appreciate create_project building in old environments.
Thank you! I've edited the PR with your suggestion.
<CommonCrypto/CommonDigest.h> should be used for CC_MD5() on macOS. Fixes the build on Leopard.
Non POSIX.1-2008 systems will not necessarily accept NULL as the second argument, and could crash the program here. Provide a temporary buffer on the stack instead, and don't count on realpath() allocating one on the heap. This will work on older POSIX.1-2001 systems. (In theory, this older POSIX.1-2001 syntax could have portability problems too, because of PATH_MAX, but in practice this shouldn't be a problem for the systems intended to be used by create_project.) Fixes the build on Mac OS X Leopard.
msbuild.h makes uses of the "override" keyword, so borrow the compat macro from c++11-compat.h to make this work on older compilers, such as the ones found on Mac OS X Leopard.