added wxCHECK_VISUALC_VERSION macro

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-01-29 12:22:13 +00:00
parent 28f0592cd9
commit a38c9b4337
3 changed files with 24 additions and 2 deletions

View File

@@ -147,8 +147,9 @@ to the compiler version: $500$ is $5.0$.}
\twocolitem{\_\_SUNCC\_\_}{Sun CC, see also \helpref{wxCHECK\_SUNCC\_VERSION}{wxchecksunccversion}} \twocolitem{\_\_SUNCC\_\_}{Sun CC, see also \helpref{wxCHECK\_SUNCC\_VERSION}{wxchecksunccversion}}
\twocolitem{\_\_SYMANTECC\_\_}{Symantec C++} \twocolitem{\_\_SYMANTECC\_\_}{Symantec C++}
\twocolitem{\_\_VISAGECPP\_\_}{IBM Visual Age (OS/2)} \twocolitem{\_\_VISAGECPP\_\_}{IBM Visual Age (OS/2)}
\twocolitem{\_\_VISUALC\_\_}{Microsoft Visual C++. The value of this macro \twocolitem{\_\_VISUALC\_\_}{Microsoft Visual C++, see also
corresponds to the compiler version: $1020$ for $4.2$ (the first supported \helpref{wxCHECK\_VISUALC\_VERSION}{wxcheckvisualcversion}. The value of this
macro corresponds to the compiler version: $1020$ for $4.2$ (the first supported
version), $1100$ for $5.0$, $1200$ for $6.0$ and so on. For convenience, the version), $1100$ for $5.0$, $1200$ for $6.0$ and so on. For convenience, the
symbols \_\_VISUALCn\_\_ are also defined for each major compiler version from symbols \_\_VISUALCn\_\_ are also defined for each major compiler version from
5 to 9, i.e. you can use tests such \texttt{#ifdef \_\_VISUALC7\_\_} to test 5 to 9, i.e. you can use tests such \texttt{#ifdef \_\_VISUALC7\_\_} to test

View File

@@ -52,6 +52,7 @@ the corresponding topic.
\helpref{wxCHECK\_SUNCC\_VERSION}{wxchecksunccversion}\\ \helpref{wxCHECK\_SUNCC\_VERSION}{wxchecksunccversion}\\
\helpref{wxCHECK\_VERSION}{wxcheckversion}\\ \helpref{wxCHECK\_VERSION}{wxcheckversion}\\
\helpref{wxCHECK\_VERSION\_FULL}{wxcheckversionfull}\\ \helpref{wxCHECK\_VERSION\_FULL}{wxcheckversionfull}\\
\helpref{wxCHECK\_VISUALC\_VERSION}{wxcheckvisualcversion}\\
\helpref{wxCHECK\_W32API\_VERSION}{wxcheckw32apiversion}\\ \helpref{wxCHECK\_W32API\_VERSION}{wxcheckw32apiversion}\\
\helpref{wxClientDisplayRect}{wxclientdisplayrect}\\ \helpref{wxClientDisplayRect}{wxclientdisplayrect}\\
\helpref{wxClipboardOpen}{functionwxclipboardopen}\\ \helpref{wxClipboardOpen}{functionwxclipboardopen}\\
@@ -365,6 +366,15 @@ Same as \helpref{wxCHECK\_VERSION}{wxcheckversion} but also checks that
\texttt{wxSUBRELEASE\_NUMBER} is at least \arg{subrel}. \texttt{wxSUBRELEASE\_NUMBER} is at least \arg{subrel}.
\membersection{wxCHECK\_VISUALC\_VERSION}\label{wxcheckvisualcversion}
\func{bool}{wxCHECK\_VISUALC\_VERSION}{\param{}{major}}
Returns $1$ if the compiler being used to compile the code is Visual C++
compiler version \arg{major} or greater. Otherwise, and also if
the compiler is not Visual C++ at all, returns $0$.
\membersection{wxCHECK\_W32API\_VERSION}\label{wxcheckw32apiversion} \membersection{wxCHECK\_W32API\_VERSION}\label{wxcheckw32apiversion}
\func{bool}{wxCHECK\_W32API\_VERSION}{\param{}{major, minor, release}} \func{bool}{wxCHECK\_W32API\_VERSION}{\param{}{major, minor, release}}

View File

@@ -559,6 +559,17 @@
#define wxNEEDS_CHARPP #define wxNEEDS_CHARPP
#endif #endif
/*
This macro can be used to test the Visual C++ version.
*/
#ifndef __VISUALC__
# define wxVISUALC_VERSION(major) 0
# define wxCHECK_VISUALC_VERSION(major) 0
#else
# define wxVISUALC_VERSION(major) ( (6 + major) * 100 )
# define wxCHECK_VISUALC_VERSION(major) ( __VISUALC__ >= wxVISUALC_VERSION(major) )
#endif
/* /*
This macro can be used to check that the version of mingw32 compiler is This macro can be used to check that the version of mingw32 compiler is
at least maj.min at least maj.min