version macrosthe following constants are defined in wxwidgets:
for example, the values or these constants for wxwidgets 2.1.15 are 2, 1 and 15. additionally, wxversion_string is a user-readable string containing the full wxwidgets version and wxversion_number is a combination of the three version numbers above: for 2.1.15, it is 2115 and it is 2200 for wxwidgets 2.2. the subrelease number is only used for the sources in between official releases and so normally is not useful. include files <wx/version.h> or <wx/defs.h>
wxcheck_gcc_version
wxcheck_gcc_versionbool wxcheck_gcc_version(major, minor) returns 1 if the compiler being used to compile the code is gnu c++ compiler (g++) version major.minor or greater. otherwise, and also if the compiler is not gnu c++ at all, returns 0.
wxcheck_versionbool wxcheck_version(major, minor, release) this is a macro which evaluates to true if the current wxwidgets version is at least major.minor.release. for example, to test if the program is compiled with wxwidgets 2.2 or higher, the following can be done:
wxstring s; #if wxcheck_version(2, 2, 0) if ( s.startswith("foo") ) #else // replacement code for old version if ( strncmp(s, "foo", 3) == 0 ) #endif { ... } wxcheck_version_fullbool wxcheck_version_full(major, minor, release, subrel) same as wxcheck_version but also checks that wxsubrelease_number is at least subrel.
wxcheck_w32api_versionbool wxcheck_w32api_version(major, minor, release) returns 1 if the version of w32api headers used is major.minor.release or greater. otherwise, and also if we are not compiling with mingw32/cygwin under win32 at all, returns 0.
|