Merge pull request #529 from dguzek/OSX-Version-LogFix-v2
OS X Version Log Fix -- v2
This commit is contained in:
@@ -440,7 +440,7 @@ if(NOT APPLE)
|
|||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
else(NOT APPLE)
|
else(NOT APPLE)
|
||||||
list(APPEND SMDATA_ARCH_HOOKS_SRC
|
list(APPEND SMDATA_ARCH_HOOKS_SRC
|
||||||
"arch/ArchHooks/ArchHooks_MacOSX.cpp"
|
"arch/ArchHooks/ArchHooks_MacOSX.mm"
|
||||||
)
|
)
|
||||||
list(APPEND SMDATA_ARCH_HOOKS_HPP
|
list(APPEND SMDATA_ARCH_HOOKS_HPP
|
||||||
"arch/ArchHooks/ArchHooks_MacOSX.h"
|
"arch/ArchHooks/ArchHooks_MacOSX.h"
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ extern "C" {
|
|||||||
#include <IOKit/network/IONetworkInterface.h>
|
#include <IOKit/network/IONetworkInterface.h>
|
||||||
#include <IOKit/network/IOEthernetController.h>
|
#include <IOKit/network/IOEthernetController.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
static bool IsFatalSignal( int signal )
|
static bool IsFatalSignal( int signal )
|
||||||
{
|
{
|
||||||
switch( signal )
|
switch( signal )
|
||||||
@@ -140,16 +142,13 @@ RString ArchHooks_MacOSX::GetArchName() const
|
|||||||
|
|
||||||
void ArchHooks_MacOSX::DumpDebugInfo()
|
void ArchHooks_MacOSX::DumpDebugInfo()
|
||||||
{
|
{
|
||||||
// Get system version
|
// Get system version (like 10.x.x)
|
||||||
RString sSystemVersion;
|
RString SystemVersion;
|
||||||
{
|
{
|
||||||
char osrelease[256];
|
// http://stackoverflow.com/a/891336
|
||||||
size_t size = sizeof(osrelease);
|
NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
|
||||||
|
NSString *productVersion = [version objectForKey:@"ProductVersion"];
|
||||||
if( sysctlbyname( "kern.osrelease", osrelease, &size, NULL, 0 ) )
|
SystemVersion = ssprintf("Mac OS X %s", [productVersion cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||||
sSystemVersion = ssprintf( "Mac OS X %s", osrelease );
|
|
||||||
else
|
|
||||||
sSystemVersion = ssprintf( "Mac OS X Unknown" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size;
|
size_t size;
|
||||||
@@ -235,7 +234,7 @@ void ArchHooks_MacOSX::DumpDebugInfo()
|
|||||||
// Send all of the information to the log
|
// Send all of the information to the log
|
||||||
LOG->Info( "Model: %s (%d/%d)", sModel.c_str(), iCPUs, iMaxCPUs );
|
LOG->Info( "Model: %s (%d/%d)", sModel.c_str(), iCPUs, iMaxCPUs );
|
||||||
LOG->Info( "Clock speed %.2f %cHz", fFreq, freqPower );
|
LOG->Info( "Clock speed %.2f %cHz", fFreq, freqPower );
|
||||||
LOG->Info( "%s", sSystemVersion.c_str());
|
LOG->Info( "%s", SystemVersion.c_str());
|
||||||
LOG->Info( "Memory: %.2f %cB", fRam, ramPower );
|
LOG->Info( "Memory: %.2f %cB", fRam, ramPower );
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user