Simple header file for detecting OS
- C 100%
| is_os.h | ||
| LICENSE | ||
| README.md | ||
IS OS
C Macro Project
Very, very basic header to determine which DESKTOP OS is being targetted.
I have several command-line projects that I make sure compile on Windows and UNIX-likes. I've grown tired of rewriting these detection macros over and over again across projects.
SET MACRO
IS_OS_H- This is always set when an OS has been successfully detected.
OS_WIN- This is set when Microsoft Windows is the target
OS_LINUX- This is set when a Linux distribution is the target
OS_BSD- This is set when a BSD distribution is the target
OS_GNUHURD- This is set when a GNU/HURD distribution is the target
OS_MAC- This is set when MacOS is the target
OS_UNIX- This is set when a Linux distribution is the target
Error
If an OS cannot be detected, the #error pragma is invoked.
License
MIT