Skip to content

A set of utilities for C99, for cross-platform compatibility.

License

Notifications You must be signed in to change notification settings

Tianscar/compat

Repository files navigation

Compat

A set of utilities for C99, for cross-platform compatibility.
Targeting compilers: GCC/MinGW (POSIX/Windows), Clang (POSIX and Windows), MSVC (Windows).

Usage

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!

Notes for Windows

For building external libraries (if required), see tests as reference.

dllexport

You need to define COMPAT_BUILDING_DLL macro if you're building an executable or shared library.

RegExp

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.

C11 threads emulation

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.

C99 standard types

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.

License

The Unlicense (Public Domain Equivalent)

About

A set of utilities for C99, for cross-platform compatibility.

Topics

Resources

License

Stars

Watchers

Forks