#include "../include/Platform.hpp" namespace sibs { bool containsPlatform(const std::vector &platforms, Platform platform) { for (Platform vecPlatform : platforms) { if(platform & vecPlatform) return true; } return false; } const char* asString(Platform platform) { switch (platform) { case PLATFORM_ANY: return "any"; case PLATFORM_LINUX: return "linux"; case PLATFORM_LINUX32: return "linux32"; case PLATFORM_LINUX64: return "linux64"; case PLATFORM_WIN: return "win"; case PLATFORM_WIN32: return "win32"; case PLATFORM_WIN64: return "win64"; case PLATFORM_MACOS: return "macos"; case PLATFORM_MACOS32: return "macos32"; case PLATFORM_MACOS64: return "macos64"; case PLATFORM_BSD: return "bsd"; case PLATFORM_OPENBSD: return "openbsd"; case PLATFORM_OPENBSD32: return "openbsd32"; case PLATFORM_OPENBSD64: return "openbsd64"; default: return nullptr; } } Platform getPlatformByName(StringView name) { auto it = PLATFORM_BY_NAME.find(name); if(it != PLATFORM_BY_NAME.end()) return it->second; return PLATFORM_INVALID; } }