A set of utilities for C99, for cross-platform compatibility.
Targeting compilers: GCC/MinGW (POSIX/Windows), Clang (POSIX and Windows), MSVC (Windows).
Copy the files to your project and #include
them. #include
compat.h to include all of them.
Do not forget to reading the notes below if you're developing for Windows!
For building external libraries (if required), see tests as reference.
You need to define COMPAT_BUILDING_DLL
macro if you're building an executable or shared library.
If you want to use regex.h, you need to build either libgnurx (LGPL-2.1) or libregex (MIT and BSD 2-Clause) and link to your executable or library.
If you want to use threads.h, you need to build c11threads (Public Domain) and link to your executable or library,
unless you're using win-pthread which you need to define COMPAT_WINPTHREAD
macro.
For MSVC _MSC_VER
< 1800, the headers for C99 standard types compatibility are force used.
You can also define COMPAT_TYPES
macro to use them if you don't want to link against any c runtime library except msvcrt.dll
.