[ox] Fix to build with MinGW

This commit is contained in:
2018-05-05 02:34:55 -05:00
parent 1e82dacd6d
commit 610f6f4246
5 changed files with 24 additions and 27 deletions

View File

@@ -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()

View File

@@ -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);
}
}