preprocessor symbols defined by wxwidgets
these are preprocessor symbols used in the wxwidgets source, grouped
by category (and sorted by alphabetical order inside each category). all of
these macros except for the wxuse_xxx variety is defined if the
corresponding condition is true and undefined if it isn't, so they should be
always tested using ifdef and not if.
gui system
operating systems
hardware architectures (cpu)
hardware type
compilers
feature tests
miscellaneous
gui system
__windows__
|
any windows, yom may also use __wxmsw__
|
__win16__
|
win16 api (not supported since wxwidgets 2.6)
|
__win32__
|
win32 api
|
__wxbase__
|
only wxbase, no gui features (same as wxuse_gui == 0)
|
__wxcocoa__
|
os x using cocoa api
|
__wxwince__
|
windows ce
|
__wxgtk__
|
gtk+
|
__wxgtk12__
|
gtk+ 1.2 or higher
|
__wxgtk20__
|
gtk+ 2.0 or higher
|
__wxmotif__
|
motif
|
__wxmotif20__
|
motif 2.0 or higher
|
__wxmac__
|
mac os all targets
|
__wxmac_classic__
|
macos for classic
|
__wxmac_carbon__
|
macos for carbon cfm (running under classic or osx) or true os x mach-o builds
|
__wxmac_osx__
|
macos x carbon mach-o builds
|
__wxmgl__
|
scitech soft mgl (__wxuniversal__ will be also
defined)
|
__wxmsw__
|
any windows
|
__wxosx__
|
any mac os x port (either carbon or cocoa)
|
__wxpalmos__
|
palmos
|
__wxpm__
|
os/2 native presentation manager
|
__wxstubs__
|
stubbed version ('template' wxwin implementation)
|
__wxxt__
|
xt; mutually exclusive with wx_motif, not
implemented in wxwidgets 2.x
|
__wxx11__
|
wxx11 (__wxuniversal__ will be also defined)
|
__wxwine__
|
wine (i.e. win32 on unix)
|
__wxuniversal__
|
wxuniversal port, always defined in addition
to one of the symbols above so this should be tested first.
|
__x__
|
any x11-based gui toolkit except gtk+
|
there are two wxwidgets ports to mac os. one of them, wxmac, exists in two versions: classic and
carbon. the classic version is the only one to work on mac os version 8. the
carbon version may be built either as cfm or mach-o (binary format, like elf)
and the former may run under os 9 while the latter only runs under os x.
finally, there is a new cocoa port which can only be used under os x. to
summarize:
- if you want to test for all mac platforms, classic and os x, you
should test both __wxmac__ and __wxcocoa__.
- if you want to test for any gui mac port under os x, use
__wxosx__.
- if you want to test for any port under mac os x, including, for
example, wxgtk and also wxbase, use __darwin__ (see below).
the convention is to use the __wx prefix for these
symbols, although this has not always been followed.
operating systems
__apple__
|
any mac os version
|
__aix__
|
aix
|
__bsd__
|
any *bsd system
|
__cygwin__
|
cygwin: unix on win32
|
__darwin__
|
mac os x using the bsd unix c library (as opposed to using the metrowerks msl c/c++ library)
|
__data_general__
|
dg-ux
|
__dos_general__
|
dos (used with wxmgl only)
|
__freebsd__
|
freebsd
|
__hpux__
|
hp-ux (unix)
|
__gnu__
|
gnu hurd
|
__linux__
|
linux
|
__mach__
|
mach-o architecture (mac os x only builds)
|
__osf__
|
osf/1
|
__palmos__
|
palmos
|
__sgi__
|
irix
|
__solaris__
|
solaris
|
__sun__
|
any sun
|
__sunos__
|
sun os
|
__svr4__
|
systemv r4
|
__sysv__
|
systemv generic
|
__ultrix__
|
ultrix
|
__unix__
|
any unix
|
__unix_like__
|
unix, beos or vms
|
__vms__
|
vms
|
__windows__
|
any windows
|
__wine__
|
wine
|
hardware architectures (cpu)
note that not all of these symbols are always defined, it depends on the
compiler used.
__alpha__
|
dec alpha architecture
|
__intel__
|
intel i386 or compatible
|
__ia64__
|
intel 64 bit architecture
|
__powerpc__
|
motorola power pc
|
hardware type
__smartphone__
|
generic mobile devices with phone buttons and a small display
|
__pda__
|
personal digital assistant, usually with touch screen
|
__handheld__
|
small but powerful computer, usually with a keyboard
|
__pocketpc__
|
microsoft-powered pocketpc devices with touch-screen
|
__wince_standardsdk__
|
microsoft-powered windows ce devices, for generic windows ce applications
|
__wince_net__
|
microsoft-powered windows ce .net devices (_win32_wce is 400 or greater)
|
win32_platform_wfsp
|
microsoft-powered smartphone
|
compilers
__borlandc__
|
borland c++. the value of the macro corresponds
to the compiler version: 500 is 5.0.
|
__djgpp__
|
djgpp
|
__digitalmars__
|
digital mars
|
__gnug__
|
gnu c++ on any platform, see also
wxcheck_gcc_version
|
__gnuwin32__
|
gnu-win32 compiler, see also
wxcheck_w32api_version
|
__mingw32__
|
mingw
|
__mwerks__
|
codewarrior metrowerks compiler
|
__suncc__
|
sun cc
|
__symantecc__
|
symantec c++
|
__visagecpp__
|
ibm visual age (os/2)
|
__visualc__
|
microsoft visual c++. 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
|
__xlc__
|
aix compiler
|
__watcomc__
|
watcom c++. the value of this macro corresponds to
the compiler version, 1100 is 11.0 and 1200 is openwatcom.
|
_win32_wce
|
windows ce version
|
feature tests
some library features may not be always available even if they were selected by
the user. to make it possible to check if this is the case, the library
predefines the symbols in the form wxhas_feature. unlike
wxuse_feature symbols which are defined by the library user (directly
in setup.h or by running configure script) and which must be always
defined as either 0 or 1, the wxhas symbols are only defined if
the corresponding feature is available and not defined at all otherwise.
currently the following symbols exist:
wxhas_large_files
|
defined if wxfile supports
files more than 4gb in size.
|
wxhas_large_ffiles
|
defined if wxffile
supports files more than 4gb in size.
|
wxhas_power_events
|
defined if
wxpowerevent are ever generated on the current platform.
|
wxhas_radio_menu_items
|
defined if the current port supports
radio menu items.
|
wxhas_raw_key_codes
|
defined if
raw key codes are supported.
|
wxhas_regex_advanced
|
defined if advanced syntax is available in
wxregex.
|
wxhas_task_bar_icon
|
defined if
wxtaskbaricon is available on the current platform.
|
miscellaneous
__wxwindows__
|
always defined in wxwidgets applications, see
also wxcheck_version
|
__wxdebug__
|
defined in debug mode, undefined in release mode
|
wxuse_xxx
|
if defined as 1, feature xxx is active
(the symbols of this form are always defined, use #if and not #ifdef to test
for them)
|
wx_precomp
|
is defined if precompiled headers (pch) are in use. in
this case, wx/wxprec.h includes wx/wx.h which, in turn,
includes a number of wxwidgets headers thus making it unnecessary to include
them explicitly. however if this is not defined, you do need to include them
and so the usual idiom which allows to support both cases is to first include
wx/wxprec.h and then, inside ifndef wx_precomp, individual
headers you need.
|
_unicode and unicode
|
both are defined if wxuse_unicode is set to 1
|
wxuse_gui
|
this particular feature test macro is defined to 1
when compiling or using the library with the gui features activated, if it is
defined as 0, only wxbase is available.
|
wxuse_base
|
only used by wxwidgets internally (defined as 1 when
building wxbase code, either as a standalone library or as part of the
monolithic wxwidgets library, defined as 0 when building gui library only)
|
wxno_rtti
|
is defined if the compiler rtti support has been switched off
|
wxno_exceptions
|
is defined if the compiler support for c++
exceptions has been switched off
|
wxno_threads
|
if this macro is defined, the compilation options
don't include compiler flags needed for multithreaded code generation. this
implies that wxuse_threads is 0 and also that other (non-wx-based) threading
packages cannot be used neither.
|
|