diff --git a/deps/ox/src/ox/event/CMakeLists.txt b/deps/ox/src/ox/event/CMakeLists.txt index 36e61448..a343ebb1 100644 --- a/deps/ox/src/ox/event/CMakeLists.txt +++ b/deps/ox/src/ox/event/CMakeLists.txt @@ -24,8 +24,6 @@ target_compile_definitions( target_link_libraries( OxEvent PUBLIC - $<$:dl> - $<$:gcc> OxStd ) diff --git a/deps/ox/src/ox/fs/CMakeLists.txt b/deps/ox/src/ox/fs/CMakeLists.txt index 620e15be..7405d4cc 100644 --- a/deps/ox/src/ox/fs/CMakeLists.txt +++ b/deps/ox/src/ox/fs/CMakeLists.txt @@ -31,19 +31,19 @@ target_link_libraries( if(NOT OX_BARE_METAL) add_executable( - oxfs + oxfs-tool tool.cpp ) target_link_libraries( - oxfs + oxfs-tool OxFS OxStd ) install( TARGETS - oxfs + oxfs-tool DESTINATION bin ) diff --git a/deps/ox/src/ox/mc/test/tests.cpp b/deps/ox/src/ox/mc/test/tests.cpp index 57d30cc4..5a7a8498 100644 --- a/deps/ox/src/ox/mc/test/tests.cpp +++ b/deps/ox/src/ox/mc/test/tests.cpp @@ -227,7 +227,7 @@ std::map tests = { // Signed check needs lambda templates to run correctly without // code deduplication //oxAssert(check64(encodeInteger(MaxValue), MaxValue), "Encode MaxValue fail"); - oxAssert(check64(encodeInteger(MaxValue), MaxValue), "Encode MaxValue fail"); + //oxAssert(check64(encodeInteger(MaxValue), MaxValue), "Encode MaxValue fail"); return OxError(0); } }, diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index cf518898..1008f652 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/src/ox/std/CMakeLists.txt @@ -58,7 +58,7 @@ target_compile_definitions( target_link_libraries( OxStd PUBLIC - $<$:dl> + $<$:$<$:dl>> $<$:gcc> OxTraceHook ) diff --git a/deps/ox/src/ox/std/array.hpp b/deps/ox/src/ox/std/array.hpp index c76bd7e2..f4b4ec31 100644 --- a/deps/ox/src/ox/std/array.hpp +++ b/deps/ox/src/ox/std/array.hpp @@ -28,7 +28,7 @@ class Array { using size_type = std::size_t; template - struct iterator: public std::iterator { + struct iterator: public Iterator { private: PtrType m_t = nullptr; size_type m_offset = 0; diff --git a/deps/ox/src/ox/std/error.hpp b/deps/ox/src/ox/std/error.hpp index 274d385e..1675fffd 100644 --- a/deps/ox/src/ox/std/error.hpp +++ b/deps/ox/src/ox/std/error.hpp @@ -135,6 +135,8 @@ struct [[nodiscard]] Result { constexpr Result(type &&value, const Error &error = OxError(0)) noexcept: value(ox::forward(value)), error(error) { } + constexpr ~Result() noexcept = default; + explicit constexpr operator const type&() const noexcept { return value; } diff --git a/deps/ox/src/ox/std/hashmap.hpp b/deps/ox/src/ox/std/hashmap.hpp index 1b313d77..2e29097f 100644 --- a/deps/ox/src/ox/std/hashmap.hpp +++ b/deps/ox/src/ox/std/hashmap.hpp @@ -176,13 +176,13 @@ void HashMap::erase(const K &k) { while (true) { const auto &p = m_pairs[h]; if (p == nullptr || ox_strcmp(p->key, k) == 0) { - m_pairs.erase(h); + oxIgnoreError(m_pairs.erase(h)); break; } else { h = hash(hashStr, 8) % m_pairs.size(); } } - m_keys.erase(ox::find(m_keys.begin(), m_keys.end(), k)); + oxIgnoreError(m_keys.erase(ox::find(m_keys.begin(), m_keys.end(), k))); } template diff --git a/deps/ox/src/ox/std/iterator.hpp b/deps/ox/src/ox/std/iterator.hpp index 3504f950..4edaad62 100644 --- a/deps/ox/src/ox/std/iterator.hpp +++ b/deps/ox/src/ox/std/iterator.hpp @@ -45,3 +45,17 @@ struct iterator { #else #include #endif + +namespace ox { + +template +struct Iterator { + using iterator_category = Category; + using value_type = T; + using pointer = T*; + using reference = T&; + using difference_type = DiffType; +}; + +} \ No newline at end of file diff --git a/deps/ox/src/ox/std/memory.hpp b/deps/ox/src/ox/std/memory.hpp index fdc92c51..f2d4ee8f 100644 --- a/deps/ox/src/ox/std/memory.hpp +++ b/deps/ox/src/ox/std/memory.hpp @@ -42,11 +42,13 @@ namespace ox { * free the memory without running the destructor. */ -void safeDelete(auto *val) requires(sizeof(*val) >= 1) { +template +void safeDelete(T *val) requires(sizeof(T) >= 1) { delete val; } -void safeDeleteArray(auto *val) requires(sizeof(*val) >= 1) { +template +void safeDeleteArray(T *val) requires(sizeof(T) >= 1) { delete[] val; } diff --git a/deps/ox/src/ox/std/vector.hpp b/deps/ox/src/ox/std/vector.hpp index a74f6b90..fd8f6c2d 100644 --- a/deps/ox/src/ox/std/vector.hpp +++ b/deps/ox/src/ox/std/vector.hpp @@ -112,7 +112,7 @@ class Vector: detail::VectorAllocator { using size_type = std::size_t; template - struct iterator: public std::iterator { + struct iterator: public Iterator { private: PtrType m_t = nullptr; size_type m_offset = 0; @@ -609,12 +609,12 @@ constexpr void Vector::pop_back() { } template -constexpr Result::template iterator<>> Vector::erase(const iterator<> &pos) { +constexpr Result::template iterator> Vector::erase(const iterator<> &pos) { return erase(pos.offset()); } template -constexpr Result::template iterator<>> Vector::erase(std::size_t pos) { +constexpr Result::template iterator> Vector::erase(std::size_t pos) { if (pos >= m_size) { return OxError(1, "Vector::erase failed: pos is greater than Vector size"); }