From cf6781cdee67c80f8008483003343ce64aba473b Mon Sep 17 00:00:00 2001 From: nipos Date: Sun, 27 Aug 2023 21:06:35 +0200 Subject: [PATCH] LibCore: Use DirectoryEntry::from_stat on Haiku --- Userland/Libraries/LibCore/DirIterator.cpp | 2 +- Userland/Libraries/LibCore/DirectoryEntry.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibCore/DirIterator.cpp b/Userland/Libraries/LibCore/DirIterator.cpp index 4bce035cc9..0e5f2c4e13 100644 --- a/Userland/Libraries/LibCore/DirIterator.cpp +++ b/Userland/Libraries/LibCore/DirIterator.cpp @@ -56,7 +56,7 @@ bool DirIterator::advance_next() return false; } -#ifdef AK_OS_SOLARIS +#if defined(AK_OS_SOLARIS) || defined(AK_OS_HAIKU) m_next = DirectoryEntry::from_stat(m_dir, *de); #else m_next = DirectoryEntry::from_dirent(*de); diff --git a/Userland/Libraries/LibCore/DirectoryEntry.cpp b/Userland/Libraries/LibCore/DirectoryEntry.cpp index 87d4f5c322..13c82b4a68 100644 --- a/Userland/Libraries/LibCore/DirectoryEntry.cpp +++ b/Userland/Libraries/LibCore/DirectoryEntry.cpp @@ -32,7 +32,7 @@ static DirectoryEntry::Type directory_entry_type_from_stat(mode_t st_mode) VERIFY_NOT_REACHED(); } -#ifndef AK_OS_SOLARIS +#if !defined(AK_OS_SOLARIS) && !defined(AK_OS_HAIKU) static DirectoryEntry::Type directory_entry_type_from_posix(unsigned char dt_constant) { switch (dt_constant) { @@ -72,7 +72,7 @@ DirectoryEntry DirectoryEntry::from_stat(DIR* d, dirent const& de) }; } -#ifndef AK_OS_SOLARIS +#if !defined(AK_OS_SOLARIS) && !defined(AK_OS_HAIKU) DirectoryEntry DirectoryEntry::from_dirent(dirent const& de) { return DirectoryEntry {