mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1173 from JeffProgrammer/gestalt_fix_gg
remove gestalt() as it has been deprecated and stopped working on Mac OS...
This commit is contained in:
commit
33037a2f45
1 changed files with 10 additions and 10 deletions
|
|
@ -31,6 +31,10 @@
|
||||||
#include "console/console.h"
|
#include "console/console.h"
|
||||||
#include "core/stringTable.h"
|
#include "core/stringTable.h"
|
||||||
|
|
||||||
|
// Gestalt has been deprecated
|
||||||
|
// we now have to use NSProcessInfo
|
||||||
|
#import <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
|
|
||||||
// Original code by Sean O'Brien (http://www.garagegames.com/community/forums/viewthread/81815).
|
// Original code by Sean O'Brien (http://www.garagegames.com/community/forums/viewthread/81815).
|
||||||
|
|
||||||
|
|
@ -89,15 +93,11 @@ void Processor::init()
|
||||||
|
|
||||||
Con::printf( "System & Processor Information:" );
|
Con::printf( "System & Processor Information:" );
|
||||||
|
|
||||||
SInt32 MacVersion;
|
// Gestalt has been deprecated since Mac OSX Mountain Lion and has stopped working on
|
||||||
if( Gestalt( gestaltSystemVersion, &MacVersion ) == noErr )
|
// Mac OSX Yosemite. we have to use NSProcessInfo now.
|
||||||
{
|
// Availability: Mac OS 10.2 or greater.
|
||||||
U32 revision = MacVersion & 0xf;
|
NSString *osVersionStr = [[NSProcessInfo processInfo] operatingSystemVersionString];
|
||||||
U32 minorVersion = ( MacVersion & 0xf0 ) >> 4;
|
Con::printf( " OSX Version: %s", [osVersionStr UTF8String]);
|
||||||
U32 majorVersion = ( MacVersion & 0xff00 ) >> 8;
|
|
||||||
|
|
||||||
Con::printf( " OSX Version: %x.%x.%x", majorVersion, minorVersion, revision );
|
|
||||||
}
|
|
||||||
|
|
||||||
err = _getSysCTLstring("kern.ostype", buf, sizeof(buf));
|
err = _getSysCTLstring("kern.ostype", buf, sizeof(buf));
|
||||||
if (err)
|
if (err)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue