- Separated Platform and Compiler Dependent Behaviour into CMake scripts

- Implemented Basic Platform Interfaces
 - Implemented partial Linux platform and Wayland Display.
 - Implemented Dependencies for the above
   - map
     - set
       - optional
     - pair

TODO: threading
This commit is contained in:
2025-07-22 00:59:41 -04:00
parent ab1c7d94be
commit 73333b4c67
86 changed files with 3257 additions and 203 deletions

View File

@@ -99,7 +99,8 @@ public:
/// \details adds additional character for null termination. Ignores whether str is null-terminated.
/// This constructor makes the assumption that `n` is the intended number of characters.
constexpr _string(const char* str, size_t n)
: _str(str, n + 1) {
: _str(n + 1) {
fennec::memcpy(_str.data(), str, n);
_str[n] = '\0';
}
@@ -318,7 +319,7 @@ public:
constexpr void resize(size_t n) {
size_t i = size();
_str.reallocate(n + 1);
if (n > i) fennec::memset(_str.data() + i, '\0', n - i);
if (n > i) fennec::memset(_str.data() + i, '\0', n + 1 - i);
}
///
@@ -387,6 +388,10 @@ public:
return res;
}
friend constexpr _string operator+(char c, _string& str) {
return _string(c, 1) + str;
}
constexpr _string operator+(const cstring& str) const {
_string res(size() + str.size()); // Make a new string with the size of this + str
fennec::memcpy(&res[0], _str.data(), size()); // Copy the contents of this