wxGetOsVersion() compilation andl inking fixes for wxMac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-08-13 22:43:30 +00:00
parent ab346e1c7e
commit c655557fa6
3 changed files with 30 additions and 43 deletions

View File

@@ -67,24 +67,20 @@
#endif #endif
#endif #endif
// --------------------------------------------------------------------------- #if wxUSE_BASE
// code used in both base and GUI compilation
// ---------------------------------------------------------------------------
// our OS version is the same in non GUI and GUI cases // our OS version is the same in non GUI and GUI cases
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
{ {
long theSystem; long theSystem;
// are there x-platform conventions ?
Gestalt(gestaltSystemVersion, &theSystem); Gestalt(gestaltSystemVersion, &theSystem);
if (minorVsn != NULL)
*minorVsn = (theSystem & 0xFF);
if (majorVsn != NULL) if ( majorVsn != NULL )
*majorVsn = (theSystem >> 8); *majorVsn = (theSystem >> 8);
if ( minorVsn != NULL )
*minorVsn = (theSystem & 0xFF);
#if defined( __DARWIN__ ) #if defined( __DARWIN__ )
return wxOS_MAC_OSX_DARWIN; return wxOS_MAC_OSX_DARWIN;
#else #else
@@ -92,10 +88,6 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
#endif #endif
} }
#if wxUSE_BASE
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// debugging support // debugging support
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -56,23 +56,20 @@
#include <wtime.h> #include <wtime.h>
#endif #endif
// --------------------------------------------------------------------------- #if wxUSE_BASE
// code used in both base and GUI compilation
// ---------------------------------------------------------------------------
// our OS version is the same in non GUI and GUI cases // our OS version is the same in non GUI and GUI cases
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
{ {
long theSystem; long theSystem;
// are there x-platform conventions ?
Gestalt(gestaltSystemVersion, &theSystem); Gestalt(gestaltSystemVersion, &theSystem);
if (minorVsn != NULL)
if ( majorVsn != NULL )
*majorVsn = (theSystem >> 8);
if ( minorVsn != NULL )
*minorVsn = (theSystem & 0xFF); *minorVsn = (theSystem & 0xFF);
if (majorVsn != NULL)
*majorVsn = (theSystem >> 8);
#if defined( __DARWIN__ ) #if defined( __DARWIN__ )
return wxOS_MAC_OSX_DARWIN; return wxOS_MAC_OSX_DARWIN;
@@ -81,8 +78,6 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
#endif #endif
} }
#if wxUSE_BASE
#ifndef __DARWIN__ #ifndef __DARWIN__
// defined in unix/utilsunx.cpp for Mac OS X // defined in unix/utilsunx.cpp for Mac OS X

View File

@@ -891,6 +891,23 @@ bool wxGetUserName(wxChar *buf, int sz)
return false; return false;
} }
bool wxIsPlatform64Bit()
{
wxString machine = wxGetCommandOutput(wxT("uname -m"));
// NOTE: these tests are not 100% reliable!
return machine.Contains(wxT("AMD64")) ||
machine.Contains(wxT("IA64")) ||
machine.Contains(wxT("x64")) ||
machine.Contains(wxT("X64")) ||
machine.Contains(wxT("alpha")) ||
machine.Contains(wxT("hppa64")) ||
machine.Contains(wxT("ppc64"));
}
// these functions are in mac/utils.cpp for wxMac
#ifndef __WXMAC__
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
{ {
// get OS version // get OS version
@@ -919,23 +936,6 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
return wxPlatformInfo::GetOperatingSystemId(kernel); return wxPlatformInfo::GetOperatingSystemId(kernel);
} }
bool wxIsPlatform64Bit()
{
wxString machine = wxGetCommandOutput(wxT("uname -m"));
// NOTE: these tests are not 100% reliable!
return machine.Contains(wxT("AMD64")) ||
machine.Contains(wxT("IA64")) ||
machine.Contains(wxT("x64")) ||
machine.Contains(wxT("X64")) ||
machine.Contains(wxT("alpha")) ||
machine.Contains(wxT("hppa64")) ||
machine.Contains(wxT("ppc64"));
}
// this function is in mac/utils.cpp for wxMac
#ifndef __WXMAC__
wxString wxGetOsDescription() wxString wxGetOsDescription()
{ {
return wxGetCommandOutput(wxT("uname -s -r -m")); return wxGetCommandOutput(wxT("uname -s -r -m"));