Changeset - r7985:f00c73d04df2
[Not reviewed]
master
0 1 0
bjarni - 17 years ago 2007-11-30 14:42:16
bjarni@openttd.org
(svn r11541) -Fix: [OSX] detect statvfs at runtime (based on OSX version) instead of compile time
This should prevent a crash on OSX 10.3 with the precompiled binaries (in the load/save windows)
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/unix.cpp
Show inline comments
 
@@ -64,12 +64,16 @@ void FiosGetDrives()
 

	
 
bool FiosGetDiskFreeSpace(const char *path, uint32 *tot)
 
{
 
	uint32 free = 0;
 

	
 
#ifdef HAS_STATVFS
 
# ifdef __APPLE__
 
	/* OSX 10.3 lacks statvfs so don't try to use it even though later versions of OSX has it. */
 
	if (MacOSVersionIsAtLeast(10, 4, 0))
 
# endif
 
	{
 
		struct statvfs s;
 

	
 
		if (statvfs(path, &s) != 0) return false;
 
		free = (uint64)s.f_frsize * s.f_bavail >> 20;
 
	}
0 comments (0 inline, 0 general)