]>
Commit | Line | Data |
---|---|---|
25c4a27c FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: const_cpp.h | |
3 | // Purpose: Preprocessor symbols | |
4 | // Author: Vadim Zeitlin | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | ||
10 | /*! | |
11 | ||
12 | @page cppconst Preprocessor symbols defined by wxWidgets | |
13 | ||
14 | These are preprocessor symbols used in the wxWidgets source, grouped | |
15 | by category (and sorted by alphabetical order inside each category). | |
16 | All of these macros except for the @c wxUSE_XXX variety is defined if the | |
17 | corresponding condition is @true and undefined if it isn't, so they should be | |
a3465294 | 18 | always tested using @ifdef and not @if. |
25c4a27c FM |
19 | |
20 | TODO: what can we use here instead of \twocolitem to keep text readable?? | |
21 | ||
22 | @li @ref guisystemconst | |
23 | @li @ref osconst | |
24 | @li @ref cpuconst | |
25 | @li @ref hardwareconst | |
26 | @li @ref compilerconst | |
27 | @li @ref featuretests | |
28 | @li @ref miscellaneousconst | |
29 | ||
30 | <hr> | |
31 | ||
32 | ||
33 | @section guisystemconst GUI system | |
34 | ||
35 | \twocolitem{__WINDOWS__}{any Windows, you may also use __WXMSW__} | |
36 | \twocolitem{__WIN16__}{Win16 API (not supported since wxWidgets 2.6)} | |
37 | \twocolitem{__WIN32__}{Win32 API} | |
38 | \twocolitem{__WXBASE__}{Only wxBase, no GUI features (same as @c wxUSE_GUI} $== 0$)} | |
39 | \twocolitem{__WXCOCOA__}{OS X using Cocoa API} | |
40 | \twocolitem{__WXDFB__}{wxUniversal using DirectFB} | |
41 | \twocolitem{__WXWINCE__}{Windows CE} | |
42 | \twocolitem{__WXGTK__}{GTK+} | |
43 | \twocolitem{__WXGTK12__}{GTK+ 1.2 or higher} | |
44 | \twocolitem{__WXGTK20__}{GTK+ 2.0 or higher} | |
45 | \twocolitem{__WXGTK24__}{GTK+ 2.4 or higher} | |
46 | \twocolitem{__WXGTK26__}{GTK+ 2.6 or higher} | |
47 | \twocolitem{__WXGTK210__}{GTK+ 2.10 or higher} | |
48 | \twocolitem{__WXMOTIF__}{Motif} | |
49 | \twocolitem{__WXMOTIF20__}{Motif 2.0 or higher} | |
50 | \twocolitem{__WXMAC__}{Mac OS all targets} | |
51 | \twocolitem{__WXMAC_CLASSIC__}{MacOS for Classic} | |
52 | \twocolitem{__WXMAC_CARBON__}{MacOS for Carbon CFM (running under Classic or OSX) or true OS X Mach-O Builds} | |
53 | \twocolitem{__WXMAC_OSX__}{MacOS X Carbon Mach-O Builds} | |
54 | \twocolitem{__WXMGL__}{SciTech Soft MGL (__WXUNIVERSAL__ will be also | |
55 | defined)} | |
56 | \twocolitem{__WXMSW__}{Any Windows} | |
57 | \twocolitem{__WXOSX__}{Any Mac OS X port (either Carbon or Cocoa)} | |
58 | \twocolitem{__WXPALMOS__}{PalmOS} | |
59 | \twocolitem{__WXPM__}{OS/2 native Presentation Manager} | |
60 | \twocolitem{__WXSTUBS__}{Stubbed version ('template' wxWin implementation)} | |
61 | \twocolitem{__WXXT__}{Xt; mutually exclusive with WX_MOTIF, not | |
62 | implemented in wxWidgets 2.x} | |
63 | \twocolitem{__WXX11__}{wxX11 (__WXUNIVERSAL__ will be also defined)} | |
64 | \twocolitem{__WXWINE__}{WINE (i.e. WIN32 on Unix)} | |
65 | \twocolitem{__WXUNIVERSAL__}{wxUniversal port, always defined in addition | |
66 | to one of the symbols above so this should be tested first.} | |
67 | \twocolitem{__X__}{any X11-based GUI toolkit except GTK+} | |
68 | ||
69 | There are two wxWidgets ports to Mac OS. One of them, wxMac, exists in two versions: | |
70 | Classic and Carbon. The Classic version is the only one to work on Mac OS version 8. | |
71 | The Carbon version may be built either as CFM or Mach-O (binary format, like ELF) | |
72 | and the former may run under OS 9 while the latter only runs under OS X. | |
73 | Finally, there is a new Cocoa port which can only be used under OS X. To | |
74 | summarize: | |
75 | ||
76 | @li If you want to test for all Mac platforms, classic and OS X, you | |
77 | should test both @c __WXMAC__ and @c __WXCOCOA__. | |
78 | @li If you want to test for any GUI Mac port under OS X, use | |
79 | @c __WXOSX__. | |
80 | @li If you want to test for any port under Mac OS X, including, for | |
81 | example, wxGTK and also wxBase, use @c __DARWIN__ (see below). | |
82 | ||
83 | The convention is to use the @c __WX prefix for these | |
84 | symbols, although this has not always been followed. | |
85 | ||
86 | @section osconst Operating systems | |
87 | ||
88 | \twocolitem{__APPLE__}{any Mac OS version} | |
89 | \twocolitem{__AIX__}{AIX} | |
90 | \twocolitem{__BSD__}{Any *BSD system} | |
91 | \twocolitem{__CYGWIN__}{Cygwin: Unix on Win32} | |
92 | \twocolitem{__DARWIN__}{Mac OS X using the BSD Unix C library (as opposed to using the Metrowerks MSL C/C++ library)} | |
93 | \twocolitem{__DATA_GENERAL__}{DG-UX} | |
94 | \twocolitem{__DOS_GENERAL__}{DOS (used with wxMGL only)} | |
95 | \twocolitem{__FREEBSD__}{FreeBSD} | |
96 | \twocolitem{__HPUX__}{HP-UX (Unix)} | |
97 | \twocolitem{__GNU__}{GNU Hurd} | |
98 | \twocolitem{__LINUX__}{Linux} | |
99 | \twocolitem{__MACH__}{Mach-O Architecture (Mac OS X only builds)} | |
100 | \twocolitem{__OSF__}{OSF/1} | |
101 | \twocolitem{__PALMOS__}{PalmOS} | |
102 | \twocolitem{__SGI__}{IRIX} | |
103 | \twocolitem{__SOLARIS__}{Solaris} | |
104 | \twocolitem{__SUN__}{Any Sun} | |
105 | \twocolitem{__SUNOS__}{Sun OS} | |
106 | \twocolitem{__SVR4__}{SystemV R4} | |
107 | \twocolitem{__SYSV__}{SystemV generic} | |
108 | \twocolitem{__ULTRIX__}{Ultrix} | |
109 | \twocolitem{__UNIX__}{any Unix} | |
110 | \twocolitem{__UNIX_LIKE__}{Unix, BeOS or VMS} | |
111 | \twocolitem{__VMS__}{VMS} | |
112 | \twocolitem{__WINDOWS__}{any Windows} | |
113 | \twocolitem{__WINE__}{Wine} | |
114 | ||
115 | ||
116 | @section cpuconst Hardware architectures (CPU) | |
117 | ||
118 | Note that not all of these symbols are always defined, it depends on the | |
119 | compiler used. | |
120 | ||
121 | \twocolitem{__ALPHA__}{DEC Alpha architecture} | |
122 | \twocolitem{__INTEL__}{Intel i386 or compatible} | |
123 | \twocolitem{__IA64__}{Intel 64 bit architecture} | |
124 | \twocolitem{__POWERPC__}{Motorola Power PC} | |
125 | ||
126 | ||
127 | @section hardwareconst Hardware type | |
128 | ||
129 | \twocolitem{__SMARTPHONE__}{Generic mobile devices with phone buttons and a small display} | |
130 | \twocolitem{__PDA__}{Personal digital assistant, usually with touch screen} | |
131 | \twocolitem{__HANDHELD__}{Small but powerful computer, usually with a keyboard} | |
132 | \twocolitem{__POCKETPC__}{Microsoft-powered PocketPC devices with touch-screen} | |
133 | \twocolitem{__WINCE_STANDARDSDK__}{Microsoft-powered Windows CE devices, for generic Windows CE applications} | |
134 | \twocolitem{__WINCE_NET__}{Microsoft-powered Windows CE .NET devices (_WIN32_WCE is 400 or greater)} | |
135 | \twocolitem{WIN32_PLATFORM_WFSP}{Microsoft-powered smartphone} | |
136 | ||
137 | ||
138 | @section compilerconst Compilers | |
139 | ||
140 | \twocolitem{__BORLANDC__}{Borland C++. The value of the macro corresponds | |
141 | to the compiler version: $500$ is $5.0$.} | |
142 | \twocolitem{__DJGPP__}{DJGPP} | |
143 | \twocolitem{__DIGITALMARS__}{Digital Mars} | |
144 | \twocolitem{__GNUG__}{Gnu C++ on any platform, see also | |
145 | \helpref{wxCHECK_GCC_VERSION}{wxcheckgccversion}} | |
146 | \twocolitem{__GNUWIN32__}{Gnu-Win32 compiler, see also | |
147 | \helpref{wxCHECK_W32API_VERSION}{wxcheckw32apiversion}} | |
148 | \twocolitem{__MINGW32__}{MinGW} | |
149 | \twocolitem{__MWERKS__}{CodeWarrior MetroWerks compiler} | |
150 | \twocolitem{__SUNCC__}{Sun CC, see also \helpref{wxCHECK_SUNCC_VERSION}{wxchecksunccversion}} | |
151 | \twocolitem{__SYMANTECC__}{Symantec C++} | |
152 | \twocolitem{__VISAGECPP__}{IBM Visual Age (OS/2)} | |
153 | \twocolitem{__VISUALC__}{Microsoft Visual C++, see also | |
154 | \helpref{wxCHECK_VISUALC_VERSION}{wxcheckvisualcversion}. The value of this | |
155 | macro corresponds to the compiler version: $1020$ for $4.2$ (the first supported | |
156 | version), $1100$ for $5.0$, $1200$ for $6.0$ and so on. For convenience, the | |
157 | symbols __VISUALCn__ are also defined for each major compiler version from | |
a3465294 | 158 | 5 to 9, i.e. you can use tests such @ifdef __VISUALC7__} to test |
25c4a27c FM |
159 | for compiler version being precisely 7.} |
160 | \twocolitem{__XLC__}{AIX compiler} | |
161 | \twocolitem{__WATCOMC__}{Watcom C++. The value of this macro corresponds to | |
162 | the compiler version, $1100$ is $11.0$ and $1200$ is OpenWatcom.} | |
163 | \twocolitem{_WIN32_WCE}{Windows CE version} | |
164 | ||
165 | ||
166 | @section featuretests Feature tests | |
167 | ||
168 | Some library features may not be always available even if they were selected by | |
169 | the user. To make it possible to check if this is the case, the library | |
170 | predefines the symbols in the form @c wxHAS_FEATURE. Unlike | |
171 | @c wxUSE_FEATURE symbols which are defined by the library user (directly | |
172 | in @c setup.h or by running configure script) and which must be always | |
173 | defined as either $0$ or $1$, the @c wxHAS symbols are only defined if | |
174 | the corresponding feature is available and not defined at all otherwise. | |
175 | ||
176 | Currently the following symbols exist: | |
177 | ||
178 | \twocolitem{wxHAS_LARGE_FILES}{Defined if \helpref{wxFile}{wxfile} supports | |
179 | files more than 4GB in size.} | |
180 | \twocolitem{wxHAS_LARGE_FFILES}{Defined if \helpref{wxFFile}{wxffile} | |
181 | supports files more than 4GB in size.} | |
182 | \twocolitem{wxHAS_POWER_EVENTS}{Defined if | |
183 | \helpref{wxPowerEvent}{wxpowerevent} are ever generated on the current platform.} | |
184 | \twocolitem{wxHAS_RADIO_MENU_ITEMS}{Defined if the current port supports | |
185 | \helpref{radio menu items}{wxmenuappendradioitem}.} | |
186 | \twocolitem{wxHAS_RAW_KEY_CODES}{Defined if | |
187 | \helpref{raw key codes}{wxkeyeventgetrawkeycode} are supported.} | |
188 | \twocolitem{wxHAS_REGEX_ADVANCED}{Defined if advanced syntax is available in | |
189 | \helpref{wxRegEx}{wxregex}.} | |
190 | \twocolitem{wxHAS_TASK_BAR_ICON}{Defined if | |
191 | \helpref{wxTaskBarIcon}{wxtaskbaricon} is available on the current platform.} | |
192 | ||
193 | ||
194 | @section miscellaneousconst Miscellaneous | |
195 | ||
196 | \twocolitem{__WXWINDOWS__}{always defined in wxWidgets applications, see | |
197 | also \helpref{wxCHECK_VERSION}{wxcheckversion}} | |
198 | \twocolitem{__WXDEBUG__}{defined in debug mode, undefined in release mode} | |
199 | \twocolitem{wxUSE_XXX}{if defined as $1$, feature XXX is active, see the | |
200 | \helpref{complete list}{wxusedef} (the symbols of this form are always defined, | |
201 | use \#if and not \#ifdef to test for them)} | |
202 | \twocolitem{WX_PRECOMP}{is defined if precompiled headers (PCH) are in use. In | |
203 | this case, @c wx/wxprec.h} includes @c wx/wx.h} which, in turn, | |
204 | includes a number of wxWidgets headers thus making it unnecessary to include | |
205 | them explicitly. However if this is not defined, you do need to include them | |
206 | and so the usual idiom which allows to support both cases is to first include | |
a3465294 | 207 | @c wx/wxprec.h} and then, inside @ifndef WX_PRECOMP}, individual |
25c4a27c FM |
208 | headers you need.} |
209 | \twocolitem{_UNICODE and UNICODE}{both are defined if wxUSE_UNICODE is set to $1$} | |
210 | \twocolitem{wxUSE_GUI}{this particular feature test macro is defined to $1$ | |
211 | when compiling or using the library with the GUI features activated, if it is | |
212 | defined as $0$, only wxBase is available.} | |
213 | \twocolitem{wxUSE_BASE}{only used by wxWidgets internally (defined as $1$ when | |
214 | building wxBase code, either as a standalone library or as part of the | |
215 | monolithic wxWidgets library, defined as $0$ when building GUI library only)} | |
216 | \twocolitem{wxNO_RTTI}{is defined if the compiler RTTI support has been switched off} | |
217 | \twocolitem{wxNO_EXCEPTIONS}{is defined if the compiler support for C++ | |
218 | exceptions has been switched off} | |
219 | \twocolitem{wxNO_THREADS}{if this macro is defined, the compilation options | |
220 | don't include compiler flags needed for multithreaded code generation. This | |
221 | implies that wxUSE_THREADS is $0$ and also that other (non-wx-based) threading | |
222 | packages cannot be used neither.} | |
223 | \twocolitem{WXMAKINGDLL_XXX}{used internally and defined when building the | |
224 | library @c XXX} as a DLL; when a monolithic wxWidgets build is used only a | |
225 | single @c WXMAKINGDLL} symbol is defined} | |
226 | \twocolitem{WXUSINGDLL}{defined when compiling code which uses wxWidgets as a | |
227 | DLL/shared library} | |
228 | \twocolitem{WXBUILDING}{defined when building wxWidgets itself, whether as a | |
229 | static or shared library} | |
230 | ||
231 | */ |