Cleanups + rearranged Haiku code

This commit is contained in:
Benjamin FRANCOIS 2021-10-03 17:57:53 -07:00
parent f3e2505473
commit 2a64385a51
2 changed files with 9 additions and 14 deletions

View File

@ -267,15 +267,7 @@ inline auto directory::copy(const string& source, const string& target) -> bool
}
#else
inline auto directoryIsFolder(DIR* dp, struct dirent* ep) -> bool {
#if defined(PLATFORM_HAIKU)
struct stat sp = {0};
stat(ep->d_name, &sp);
if S_ISDIR(sp.st_mode) return true;
if (S_ISLNK(sp.st_mode) || not S_ISREG(sp.st_mode)) {
fstatat(dirfd(dp), ep->d_name, &sp, 0);
return S_ISDIR(sp.st_mode);
}
#else // not PLATFORM_HAIKU
#if defined(PLATFORM_MACOS) || defined(PLATFORM_LINUX) || defined(PLATFORM_BSD)
if(ep->d_type == DT_DIR) return true;
if(ep->d_type == DT_LNK || ep->d_type == DT_UNKNOWN) {
//symbolic links must be resolved to determine type
@ -283,6 +275,14 @@ inline auto directory::copy(const string& source, const string& target) -> bool
fstatat(dirfd(dp), ep->d_name, &sp, 0);
return S_ISDIR(sp.st_mode);
}
#else // strictly POSIX systems
struct stat sp = {0};
stat(ep->d_name, &sp);
if S_ISDIR(sp.st_mode) return true;
if (S_ISLNK(sp.st_mode) || not S_ISREG(sp.st_mode)) {
fstatat(dirfd(dp), ep->d_name, &sp, 0);
return S_ISDIR(sp.st_mode);
}
#endif
return false;
}

View File

@ -35,11 +35,6 @@ ifeq ($(ruby),)
$(eval $(call pkg_check,libpulse,audio.pulseaudiosimple))
ruby += input.xlib
$(eval $(call pkg_check,sdl2,input.sdl))
else ifeq ($(platform),haiku)
ruby += video.glx video.glx2
ruby += audio.oss
$(eval $(call pkg_check,openal,audio.openal))
$(eval $(call pkg_check,sdl2,input.sdl))
endif
endif