[WIP] Update to Mac OS X 10.9 SDK
Untested Parts
--------------
`ArchHooks_MacOSX::DumpDebugInfo()`
- Used `sysctlbyname` to find the Mac OS X version instead of the deprecated `Gestalt`.
- http://stackoverflow.com/questions/11072804/how-do-i-determine-the-os-version-at-runtime-in-os-x-or-ios-without-using-gesta
`MemoryCardDriverThreaded_MacOSX::Unmount( UsbStorageDevice *pDevice )`
- Updated to use `sync_volume_np` instead of deprecated `PBFlushVolSync`.
- http://lists.apple.com/archives/carbon-dev/2010/Nov/msg00030.html
This commit is contained in:
@@ -223,15 +223,13 @@ void ArchHooks_MacOSX::DumpDebugInfo()
|
||||
// Get system version
|
||||
RString sSystemVersion;
|
||||
{
|
||||
long major = 0, minor = 0, bugFix = 0;
|
||||
|
||||
Gestalt( gestaltSystemVersionMajor, &major );
|
||||
Gestalt( gestaltSystemVersionMinor, &minor );
|
||||
Gestalt( gestaltSystemVersionBugFix, &bugFix );
|
||||
if( bugFix )
|
||||
sSystemVersion = ssprintf( "Mac OS X %ld.%ld.%ld", major, minor, bugFix );
|
||||
char osrelease[256];
|
||||
size_t size = sizeof(osrelease);
|
||||
|
||||
if( sysctlbyname( "kern.osrelease", osrelease, &size, NULL, 0 ) )
|
||||
sSystemVersion = ssprintf( "Mac OS X %s", osrelease );
|
||||
else
|
||||
sSystemVersion = ssprintf( "Mac OS X %ld.%ld", major, minor );
|
||||
sSystemVersion = ssprintf( "Mac OS X Unknown" );
|
||||
}
|
||||
|
||||
size_t size;
|
||||
|
||||
@@ -59,18 +59,8 @@ MemoryCardDriverThreaded_MacOSX::~MemoryCardDriverThreaded_MacOSX()
|
||||
}
|
||||
|
||||
void MemoryCardDriverThreaded_MacOSX::Unmount( UsbStorageDevice *pDevice )
|
||||
{
|
||||
ParamBlockRec pb;
|
||||
Str255 name; // A pascal string.
|
||||
const RString& base = Basename( pDevice->sOsMountDir );
|
||||
|
||||
memset( &pb, 0, sizeof(pb) );
|
||||
name[0] = min( base.length(), size_t(255) );
|
||||
strncpy( (char *)&name[1], base, name[0] );
|
||||
pb.volumeParam.ioNamePtr = name;
|
||||
pb.volumeParam.ioVolIndex = -1; // Use ioNamePtr to find the volume.
|
||||
|
||||
if( PBFlushVolSync(&pb) != noErr )
|
||||
{
|
||||
if( sync_volume_np( pDevice->sOsMountDir.c_str(), SYNC_VOLUME_FULLSYNC | SYNC_VOLUME_WAIT ) != 0 )
|
||||
LOG->Warn( "Failed to flush the memory card." );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ inline Boolean LongValue( CFTypeRef o, long &n )
|
||||
|
||||
namespace __gnu_cxx
|
||||
{
|
||||
#ifndef __LP64__
|
||||
template<>
|
||||
struct hash<IOHIDElementCookie> : private hash<uintptr_t>
|
||||
{
|
||||
@@ -53,6 +54,7 @@ namespace __gnu_cxx
|
||||
return hash<unsigned long>::operator()( uintptr_t(cookie) );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This is just awful, these aren't objects, treating them as such
|
||||
|
||||
Reference in New Issue
Block a user