corrected access to NULL parameters in wxGetOsVersion

replaced wxMACINTOSH with wxMAC and wxMAC_DARWIN to differentiate return
value of wxGetOsVersion according to whether Mac paths or Unix paths are used


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2001-10-31 22:23:58 +00:00
parent a3df447d8b
commit ff8fda3617
5 changed files with 38 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ The following constants are defined in wxWindows:
\begin{itemize}\itemsep=0pt \begin{itemize}\itemsep=0pt
\item {\tt wxMAJOR\_VERSION} is the major version of wxWindows \item {\tt wxMAJOR\_VERSION} is the major version of wxWindows
\item {\tt wxMINOR\_VERSION} is the minor version of wxWindows \item {\tt wxMINOR\_VERSION} is the minor version of wxWindows
\item {\tt wxRELASE\_NUMBER} is the release number \item {\tt wxRELEASE\_NUMBER} is the release number
\end{itemize} \end{itemize}
For example, the values or these constants for wxWindows 2.1.15 are 2, 1 and For example, the values or these constants for wxWindows 2.1.15 are 2, 1 and
@@ -1698,7 +1698,7 @@ Gets operating system version information.
\begin{twocollist}\itemsep=0pt \begin{twocollist}\itemsep=0pt
\twocolitemruled{Platform}{Return types} \twocolitemruled{Platform}{Return types}
\twocolitem{Macintosh}{Return value is wxMACINTOSH.} \twocolitem{Mac OS}{Return value is wxMAC when compiled with CodeWarrior under Mac OS 8.x/9.x and Mac OS X, wxMAC_DARWIN when compiled with the Apple Developer Tools under Mac OS X.}
\twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. } \twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. }
\twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.} \twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.}
\twocolitem{OS/2}{Return value is wxOS2\_PM.} \twocolitem{OS/2}{Return value is wxOS2\_PM.}

View File

@@ -385,7 +385,8 @@ enum
wxMOTIF_X, // OSF Motif 1.x.x wxMOTIF_X, // OSF Motif 1.x.x
wxCOSE_X, // OSF Common Desktop Environment wxCOSE_X, // OSF Common Desktop Environment
wxNEXTSTEP, // NeXTStep wxNEXTSTEP, // NeXTStep
wxMACINTOSH, // Apple System 7 and 8 wxMAC, // Apple Mac OS 8/9/X with Mac paths
wxMAC_DARWIN, // Apple Mac OS X with Unix paths
wxBEOS, // BeOS wxBEOS, // BeOS
wxGTK, // GTK on X wxGTK, // GTK on X
wxGTK_WIN32, // GTK on Win32 wxGTK_WIN32, // GTK on Win32

View File

@@ -1503,7 +1503,8 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
switch ( wxGetOsVersion() ) switch ( wxGetOsVersion() )
{ {
case wxMOTIF_X: port = _T("Motif"); break; case wxMOTIF_X: port = _T("Motif"); break;
case wxMACINTOSH: port = _T("Mac"); break; case wxMAC:
case wxMAC_DARWIN: port = _T("Mac"); break;
case wxBEOS: port = _T("BeOS"); break; case wxBEOS: port = _T("BeOS"); break;
case wxGTK: case wxGTK:
case wxGTK_WIN32: case wxGTK_WIN32:

View File

@@ -190,11 +190,22 @@ void wxBell()
int wxGetOsVersion(int *majorVsn, int *minorVsn) int wxGetOsVersion(int *majorVsn, int *minorVsn)
{ {
long theSystem ; long theSystem ;
Gestalt(gestaltSystemVersion, &theSystem) ;
*minorVsn = (theSystem & 0xFF ) ; // are there x-platform conventions ?
*majorVsn = (theSystem >> 8 ) ; // are there x-platform conventions ?
return wxMACINTOSH; Gestalt(gestaltSystemVersion, &theSystem) ;
if (minorVsn != NULL) {
*minorVsn = (theSystem & 0xFF ) ;
}
if (majorVsn != NULL) {
*majorVsn = (theSystem >> 8 ) ;
}
#ifdef __DARWIN__
return wxMAC_DARWIN;
#else
return wxMAC;
#endif
} }
// Reading and writing resources (eg WIN.INI, .Xdefaults) // Reading and writing resources (eg WIN.INI, .Xdefaults)

View File

@@ -190,11 +190,22 @@ void wxBell()
int wxGetOsVersion(int *majorVsn, int *minorVsn) int wxGetOsVersion(int *majorVsn, int *minorVsn)
{ {
long theSystem ; long theSystem ;
Gestalt(gestaltSystemVersion, &theSystem) ;
*minorVsn = (theSystem & 0xFF ) ; // are there x-platform conventions ?
*majorVsn = (theSystem >> 8 ) ; // are there x-platform conventions ?
return wxMACINTOSH; Gestalt(gestaltSystemVersion, &theSystem) ;
if (minorVsn != NULL) {
*minorVsn = (theSystem & 0xFF ) ;
}
if (majorVsn != NULL) {
*majorVsn = (theSystem >> 8 ) ;
}
#ifdef __DARWIN__
return wxMAC_DARWIN;
#else
return wxMAC;
#endif
} }
// Reading and writing resources (eg WIN.INI, .Xdefaults) // Reading and writing resources (eg WIN.INI, .Xdefaults)