From e33c2070435a31d191bd202ab9818d3be6ad7ce1 Mon Sep 17 00:00:00 2001 From: nia Date: Fri, 25 Oct 2024 10:39:25 +0200 Subject: [PATCH] Build on more Unix-like OSes (BSD, illumos, etc) Signed-off-by: Nia Alarie --- Source/FpUtils.cpp | 2 +- Source/Posix_VolumeStream.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/FpUtils.cpp b/Source/FpUtils.cpp index 285dae303..5e4ab4850 100644 --- a/Source/FpUtils.cpp +++ b/Source/FpUtils.cpp @@ -10,7 +10,7 @@ #elif TARGET_CPU_ARM64 #define DENORM_AARCH64 #endif -#elif defined(__ANDROID__) || defined(__linux__) || defined(__FreeBSD__) +#elif !defined(__EMSCRIPTEN__) #if defined(__i386__) || defined(__x86_64__) #define DENORM_X86 #elif defined(__aarch64__) diff --git a/Source/Posix_VolumeStream.cpp b/Source/Posix_VolumeStream.cpp index db346dda3..28ffbe247 100644 --- a/Source/Posix_VolumeStream.cpp +++ b/Source/Posix_VolumeStream.cpp @@ -8,7 +8,7 @@ #if defined(__APPLE__) #include #include -#elif defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) +#else #include #include #endif @@ -29,15 +29,13 @@ CVolumeStream::CVolumeStream(const char* volumePath) { throw std::runtime_error("Can't get sector size."); } -#elif defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) +#else struct statvfs s; if(fstatvfs(m_fd, &s)) { throw std::runtime_error("Can't get sector size."); } m_sectorSize = s.f_bsize; -#else -#error Unsupported #endif m_cache = malloc(m_sectorSize); m_cacheSector = m_sectorSize - 1;