mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
osx : fix syscalls
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#ifdef OSX
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#elif defined(LINUX)
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
@@ -583,8 +585,14 @@ int CSystem::GetAvailableDrives(char *buf, int bufLen)
|
||||
//-----------------------------------------------------------------------------
|
||||
double CSystem::GetFreeDiskSpace(const char *path)
|
||||
{
|
||||
#if __DARWIN_ONLY_64_BIT_INO_T
|
||||
// MoeMod: newer macOS only support 64bit, so no statfs64 is provided
|
||||
struct statfs buf;
|
||||
int ret = statfs( path, &buf );
|
||||
#else
|
||||
struct statfs64 buf;
|
||||
int ret = statfs64( path, &buf );
|
||||
#endif
|
||||
if ( ret < 0 )
|
||||
return 0.0;
|
||||
return (double) ( buf.f_bsize * buf.f_bfree );
|
||||
|
||||
Reference in New Issue
Block a user