[ox] Fix to build with MinGW
This commit is contained in:
32
deps/ox/src/ox/fs/CMakeLists.txt
vendored
32
deps/ox/src/ox/fs/CMakeLists.txt
vendored
@@ -17,19 +17,19 @@ set_property(
|
||||
)
|
||||
|
||||
if(OX_BUILD_EXEC STREQUAL "ON")
|
||||
add_executable(
|
||||
oxfstool
|
||||
toollib.cpp
|
||||
oxfstool.cpp
|
||||
)
|
||||
set_target_properties(oxfstool PROPERTIES OUTPUT_NAME oxfs)
|
||||
target_link_libraries(
|
||||
oxfstool
|
||||
OxFS
|
||||
OxTrace
|
||||
OxMetalClaw
|
||||
OxStd
|
||||
)
|
||||
#add_executable(
|
||||
# oxfstool
|
||||
# toollib.cpp
|
||||
# oxfstool.cpp
|
||||
#)
|
||||
#set_target_properties(oxfstool PROPERTIES OUTPUT_NAME oxfs)
|
||||
#target_link_libraries(
|
||||
# oxfstool
|
||||
# OxFS
|
||||
# OxTrace
|
||||
# OxMetalClaw
|
||||
# OxStd
|
||||
#)
|
||||
endif()
|
||||
|
||||
install(
|
||||
@@ -58,7 +58,7 @@ if(OX_BUILD_EXEC STREQUAL "ON")
|
||||
if(OX_RUN_TESTS STREQUAL "ON")
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
install(TARGETS oxfstool
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
#install(TARGETS oxfstool
|
||||
# RUNTIME DESTINATION bin
|
||||
#)
|
||||
endif()
|
||||
|
9
deps/ox/src/ox/fs/filesystem2/directory.hpp
vendored
9
deps/ox/src/ox/fs/filesystem2/directory.hpp
vendored
@@ -91,7 +91,7 @@ class Directory {
|
||||
|
||||
Error rm(PathIterator it) noexcept;
|
||||
|
||||
ValErr<InodeId_t> find(PathIterator it) const noexcept;
|
||||
ValErr<InodeId_t> find(const char *name) const noexcept;
|
||||
|
||||
};
|
||||
|
||||
@@ -154,15 +154,12 @@ Error Directory<InodeId_t>::rm(PathIterator) noexcept {
|
||||
}
|
||||
|
||||
template<typename InodeId_t>
|
||||
ValErr<InodeId_t> Directory<InodeId_t>::find(PathIterator it) const noexcept {
|
||||
ValErr<InodeId_t> Directory<InodeId_t>::find(const char *name) const noexcept {
|
||||
ValErr<InodeId_t> retval = {0, 1};
|
||||
auto size = it.nextSize();
|
||||
auto name = ox_malloca(size + 1, char);
|
||||
it.next(name, size);
|
||||
auto buff = m_fs->read(m_inodeId).template to<Buffer>();
|
||||
for (auto i = buff->iterator(); i.hasNext(); i.next()) {
|
||||
auto data = i->data();
|
||||
if (data.valid() && data->name == name.get()) {
|
||||
if (data.valid() && data->name == name) {
|
||||
retval = static_cast<InodeId_t>(data->inode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user