mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
Build on more Unix-like OSes (BSD, illumos, etc)
Signed-off-by: Nia Alarie <nia@NetBSD.org>
This commit is contained in:
parent
b9c5c4d8d3
commit
e33c207043
2 changed files with 3 additions and 5 deletions
|
@ -10,7 +10,7 @@
|
||||||
#elif TARGET_CPU_ARM64
|
#elif TARGET_CPU_ARM64
|
||||||
#define DENORM_AARCH64
|
#define DENORM_AARCH64
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__ANDROID__) || defined(__linux__) || defined(__FreeBSD__)
|
#elif !defined(__EMSCRIPTEN__)
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
#define DENORM_X86
|
#define DENORM_X86
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <sys/disk.h>
|
#include <sys/disk.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,15 +29,13 @@ CVolumeStream::CVolumeStream(const char* volumePath)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Can't get sector size.");
|
throw std::runtime_error("Can't get sector size.");
|
||||||
}
|
}
|
||||||
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)
|
#else
|
||||||
struct statvfs s;
|
struct statvfs s;
|
||||||
if(fstatvfs(m_fd, &s))
|
if(fstatvfs(m_fd, &s))
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Can't get sector size.");
|
throw std::runtime_error("Can't get sector size.");
|
||||||
}
|
}
|
||||||
m_sectorSize = s.f_bsize;
|
m_sectorSize = s.f_bsize;
|
||||||
#else
|
|
||||||
#error Unsupported
|
|
||||||
#endif
|
#endif
|
||||||
m_cache = malloc(m_sectorSize);
|
m_cache = malloc(m_sectorSize);
|
||||||
m_cacheSector = m_sectorSize - 1;
|
m_cacheSector = m_sectorSize - 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue