diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-10 07:59:51 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 7c24c5d0de4d3584d6d2f9f3c26b4d757b0a0df2 (patch) | |
tree | 81585a1be9126c4bc1be946e74b4b6e1d706279b /include/Platform.hpp | |
parent | 6b238d4bc3c142f6337a73d858e069cae778dc54 (diff) |
Fix sibs test not including parent library correctly
Refactor config parsing to reduce number of changes when introducing a
new platform to support
Diffstat (limited to 'include/Platform.hpp')
-rw-r--r-- | include/Platform.hpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/Platform.hpp b/include/Platform.hpp index ffe7038..3ae3d24 100644 --- a/include/Platform.hpp +++ b/include/Platform.hpp @@ -29,9 +29,9 @@ namespace sibs PLATFORM_OPENBSD32 = 1 << 12 | PLATFORM_OPENBSD, PLATFORM_OPENBSD64 = 1 << 13 | PLATFORM_OPENBSD, - PLATFORM_HAIKU = 1 << 20, - PLATFORM_HAIKU32 = 1 << 21 | PLATFORM_HAIKU, - PLATFORM_HAIKU64 = 1 << 22 | PLATFORM_HAIKU + PLATFORM_HAIKU = 1 << 20, + PLATFORM_HAIKU32 = 1 << 21 | PLATFORM_HAIKU, + PLATFORM_HAIKU64 = 1 << 22 | PLATFORM_HAIKU }; const StringViewMap<Platform> PLATFORM_BY_NAME = { @@ -49,13 +49,18 @@ namespace sibs { "openbsd", PLATFORM_OPENBSD }, { "openbsd32", PLATFORM_OPENBSD32 }, { "openbsd64", PLATFORM_OPENBSD64 }, - { "haiku", PLATFORM_HAIKU }, - { "haiku32", PLATFORM_HAIKU32 }, - { "haiku64", PLATFORM_HAIKU64 }, + { "haiku", PLATFORM_HAIKU }, + { "haiku32", PLATFORM_HAIKU32 }, + { "haiku64", PLATFORM_HAIKU64 }, }; bool containsPlatform(const std::vector<Platform> &platforms, Platform platform); const char* asString(Platform platform); Platform getPlatformByName(StringView name); + // Return true if both platforms are of same type, for example if platform @a is either win, win32, win64 and @b is either win, win32, win64 bool isSamePlatformFamily(Platform a, Platform b); + // Returns true if platform @base is a base platform for platform @platform, for example if @platform is win64 and @base is either win64 or win, then this function return true. + // If for example @platform is win64 and @base is win32, then this function returns false. + bool isBaseForPlatform(Platform base, Platform platform); + Platform getPlatformGenericType(Platform platform); } |