Skip to content

Instantly share code, notes, and snippets.

@Polda18
Created February 7, 2018 06:34
Show Gist options
  • Save Polda18/92afc1a22dda16f0c45d3afdce4a66ef to your computer and use it in GitHub Desktop.
Save Polda18/92afc1a22dda16f0c45d3afdce4a66ef to your computer and use it in GitHub Desktop.
Environment branching
/****************************************
* OS environment branching
****************************************/
#ifndef __OS_ENVIRO_H__
#define __OS_ENVIRO_H__
#if defined(unix) || defined(__unix) || defined(__unix__)
#define UNIX
#elif defined(__APPLE__) || defined(__MACH__)
#define MAC_OS
#elif defined(__CYGWIN__) || defined(__CYGWIN64__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64) || defined(__WIN64__) || defined(WINNT) || defined(__WINNT) || defined(__WINNT__)
#define WINDOWS
#else
// Write code for other OS environments here
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment