libcx/src/include/cx/config/platform.hpp

24 lines
535 B
C++

#ifndef _H_LIBCX_CONFIG_PLATFORM
#if defined(__linux__)
#define PLATFORM_LINUX
#elif defined(__APPLE__) && defined(__MACH__)
#define PLATFORM_MACOS
#elif defined(__FreeBSD__)
#define PLATFORM_FREEBSD
#elif defined(__NetBSD__)
#define PLATFORM_NETBSD
#elif defined(__OpenBSD__)
#define PLATFORM_OPENBSD
#elif defined(_WIN32)
#define PLATFORM_WINDOWS
#else
#define PLATFORM_UNKNOWN
#endif
#ifdef PLATFORM_UNKNOWN
#error This platform is not supported by this library yet
#endif // PLATFORM_UNKNOWN
#endif // !_H_LIBCX_CONFIG_PLATFORM