]>
Commit | Line | Data |
---|---|---|
4514447c FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: const_cpp.h | |
3 | // Purpose: Preprocessor symbols | |
4 | // Author: Vadim Zeitlin | |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
4514447c FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
9 | ||
880efa2a | 10 | /** |
4514447c | 11 | |
928f1a07 FM |
12 | @page 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 | |
18 | always tested using @ifdef_ and not @if_. | |
19 | ||
20 | @li @ref page_cppconst_guisystem | |
21 | @li @ref page_cppconst_os | |
22 | @li @ref page_cppconst_cpu | |
23 | @li @ref page_cppconst_hardware | |
24 | @li @ref page_cppconst_compiler | |
25 | @li @ref page_cppconst_featuretests | |
3fb26cf2 | 26 | @li @ref page_cppconst_msvc_setup_h |
928f1a07 FM |
27 | @li @ref page_cppconst_miscellaneous |
28 | ||
29 | <hr> | |
30 | ||
31 | ||
32 | @section page_cppconst_guisystem GUI system | |
33 | ||
34 | @beginDefList | |
35 | @itemdef{__WINDOWS__, any Windows, you may also use __WXMSW__} | |
36 | @itemdef{__WIN16__, Win16 API (not supported since wxWidgets 2.6)} | |
37 | @itemdef{__WIN32__, Win32 API} | |
e2742bd6 | 38 | @itemdef{__WXBASE__, Only wxBase, no GUI features (same as @c wxUSE_GUI == 0)} |
3f63d141 | 39 | @itemdef{__WXCOCOA__, OS X using wxCocoa Port} |
928f1a07 FM |
40 | @itemdef{__WXDFB__, wxUniversal using DirectFB} |
41 | @itemdef{__WXWINCE__, Windows CE} | |
42 | @itemdef{__WXGTK__, GTK+} | |
43 | @itemdef{__WXGTK12__, GTK+ 1.2 or higher} | |
44 | @itemdef{__WXGTK20__, GTK+ 2.0 or higher} | |
45 | @itemdef{__WXGTK24__, GTK+ 2.4 or higher} | |
46 | @itemdef{__WXGTK26__, GTK+ 2.6 or higher} | |
47 | @itemdef{__WXGTK210__, GTK+ 2.10 or higher} | |
3f63d141 | 48 | @itemdef{__WXMAC__, old define for Mac OS X} |
928f1a07 FM |
49 | @itemdef{__WXMOTIF__, Motif} |
50 | @itemdef{__WXMOTIF20__, Motif 2.0 or higher} | |
928f1a07 FM |
51 | @itemdef{__WXMGL__, SciTech Soft MGL (__WXUNIVERSAL__ will be also defined)} |
52 | @itemdef{__WXMSW__, Any Windows} | |
3f63d141 SC |
53 | @itemdef{__WXOSX__, any OS X} |
54 | @itemdef{__WXOSX_IPHONE__, OS X iPhone} | |
55 | @itemdef{__WXOSX_CARBON__, Mac OS X using Carbon} | |
56 | @itemdef{__WXOSX_COCOA__, Mac OS X using Cocoa} | |
57 | @itemdef{__WXOSX_MAC__, Mac OS X (Carbon or Cocoa)} | |
58 | @itemdef{__WXOSX_OR_COCOA__, Any Mac OS X port (wxOSX-Carbon, wxOSX-Cocoa or | |
59 | wxCocoa)} | |
928f1a07 FM |
60 | @itemdef{__WXPALMOS__, PalmOS} |
61 | @itemdef{__WXPM__, OS/2 native Presentation Manager} | |
62 | @itemdef{__WXSTUBS__, Stubbed version ('template' wxWin implementation)} | |
63 | @itemdef{__WXXT__, Xt; mutually exclusive with WX_MOTIF, not implemented in wxWidgets 2.x} | |
64 | @itemdef{__WXX11__, wxX11 (__WXUNIVERSAL__ will be also defined)} | |
65 | @itemdef{__WXWINE__, WINE (i.e. WIN32 on Unix)} | |
66 | @itemdef{__WXUNIVERSAL__, wxUniversal port, always defined in addition | |
67 | to one of the symbols above so this should be tested first.} | |
68 | @itemdef{__X__, any X11-based GUI toolkit except GTK+} | |
69 | @endDefList | |
70 | ||
3f63d141 SC |
71 | There are two wxWidgets ports to Mac OS X. One of them, wxOSX is the successor of the |
72 | venerable wxMac, it currently exists in three versions: Carbon and Cocoa for the | |
73 | desktop and a very early iPhone port. And there is the Cocoa port named wxCocoa | |
74 | which has not been updated very actively since beginning 2008. To summarize: | |
928f1a07 | 75 | |
3f63d141 SC |
76 | @li If you want to test for wxOSX on the desktop, use |
77 | @c __WXOSX_MAC__. | |
78 | @li If you want to test for wxOSX on the iPhone, use | |
79 | @c __WXOSX_IPHONE__. | |
928f1a07 | 80 | @li If you want to test for any GUI Mac port under OS X, use |
3f63d141 | 81 | @c __WXOSX_OR_COCOA__. |
928f1a07 FM |
82 | @li If you want to test for any port under Mac OS X, including, for |
83 | example, wxGTK and also wxBase, use @c __DARWIN__ (see below). | |
84 | ||
85 | The convention is to use the @c __WX prefix for these | |
86 | symbols, although this has not always been followed. | |
87 | ||
88 | ||
89 | @section page_cppconst_os Operating systems | |
90 | ||
91 | @beginDefList | |
92 | @itemdef{__APPLE__, any Mac OS version} | |
93 | @itemdef{__AIX__, AIX} | |
94 | @itemdef{__BSD__, Any *BSD system} | |
95 | @itemdef{__CYGWIN__, Cygwin: Unix on Win32} | |
96 | @itemdef{__DARWIN__, Mac OS X using the BSD Unix C library | |
97 | (as opposed to using the Metrowerks MSL C/C++ library)} | |
98 | @itemdef{__DATA_GENERAL__, DG-UX} | |
99 | @itemdef{__DOS_GENERAL__, DOS (used with wxMGL only)} | |
100 | @itemdef{__FREEBSD__, FreeBSD} | |
101 | @itemdef{__HPUX__, HP-UX (Unix)} | |
102 | @itemdef{__GNU__, GNU Hurd} | |
103 | @itemdef{__LINUX__, Linux} | |
104 | @itemdef{__MACH__, Mach-O Architecture (Mac OS X only builds)} | |
105 | @itemdef{__OSF__, OSF/1} | |
229251af | 106 | @itemdef{__QNX__, QNX Neutrino RTOS} |
928f1a07 FM |
107 | @itemdef{__PALMOS__, PalmOS} |
108 | @itemdef{__SGI__, IRIX} | |
109 | @itemdef{__SOLARIS__, Solaris} | |
110 | @itemdef{__SUN__, Any Sun} | |
111 | @itemdef{__SUNOS__, Sun OS} | |
112 | @itemdef{__SVR4__, SystemV R4} | |
113 | @itemdef{__SYSV__, SystemV generic} | |
114 | @itemdef{__ULTRIX__, Ultrix} | |
115 | @itemdef{__UNIX__, any Unix} | |
116 | @itemdef{__UNIX_LIKE__, Unix, BeOS or VMS} | |
117 | @itemdef{__VMS__, VMS} | |
118 | @itemdef{__WINDOWS__, any Windows} | |
119 | @itemdef{__WINE__, Wine} | |
3795f11f | 120 | @itemdef{_WIN32_WCE, Windows CE version} |
928f1a07 FM |
121 | @endDefList |
122 | ||
123 | ||
124 | ||
125 | @section page_cppconst_cpu Hardware architectures (CPU) | |
126 | ||
127 | Note that not all of these symbols are always defined, it depends on the | |
128 | compiler used. | |
129 | ||
130 | @beginDefList | |
131 | @itemdef{__ALPHA__, DEC Alpha architecture} | |
132 | @itemdef{__INTEL__, Intel i386 or compatible} | |
133 | @itemdef{__IA64__, Intel 64 bit architecture} | |
134 | @itemdef{__POWERPC__, Motorola Power PC} | |
135 | @endDefList | |
136 | ||
137 | ||
138 | ||
139 | @section page_cppconst_hardware Hardware type | |
140 | ||
141 | @beginDefList | |
142 | @itemdef{__SMARTPHONE__, Generic mobile devices with phone buttons and a small display} | |
143 | @itemdef{__PDA__, Personal digital assistant, usually with touch screen} | |
144 | @itemdef{__HANDHELD__, Small but powerful computer, usually with a keyboard} | |
145 | @itemdef{__POCKETPC__, Microsoft-powered PocketPC devices with touch-screen} | |
146 | @itemdef{__WINCE_STANDARDSDK__, Microsoft-powered Windows CE devices, for generic Windows CE applications} | |
147 | @itemdef{__WINCE_NET__, Microsoft-powered Windows CE .NET devices (_WIN32_WCE is 400 or greater)} | |
148 | @itemdef{WIN32_PLATFORM_WFSP, Microsoft-powered smartphone} | |
149 | @endDefList | |
150 | ||
151 | ||
152 | ||
153 | @section page_cppconst_compiler Compilers | |
154 | ||
155 | @beginDefList | |
156 | @itemdef{__BORLANDC__, Borland C++. The value of the macro corresponds | |
e2742bd6 | 157 | to the compiler version: 500 is 5.0.} |
928f1a07 FM |
158 | @itemdef{__DJGPP__, DJGPP} |
159 | @itemdef{__DIGITALMARS__, Digital Mars} | |
3795f11f | 160 | @itemdef{__EVC4__, Embedded Visual C++ 4 (can be only used for building wxWinCE)} |
928f1a07 FM |
161 | @itemdef{__GNUG__, Gnu C++ on any platform, see also wxCHECK_GCC_VERSION} |
162 | @itemdef{__GNUWIN32__, Gnu-Win32 compiler, see also wxCHECK_W32API_VERSION} | |
163 | @itemdef{__MINGW32__, MinGW} | |
164 | @itemdef{__MWERKS__, CodeWarrior MetroWerks compiler} | |
165 | @itemdef{__SUNCC__, Sun CC, see also wxCHECK_SUNCC_VERSION} | |
166 | @itemdef{__SYMANTECC__, Symantec C++} | |
167 | @itemdef{__VISAGECPP__, IBM Visual Age (OS/2)} | |
4461c518 | 168 | @itemdef{__VISUALC__, Microsoft Visual C++, see also ::wxCHECK_VISUALC_VERSION. |
928f1a07 FM |
169 | The value of this macro corresponds to the compiler version: |
170 | @c 1020 for @c 4.2 (the first supported version), @c 1100 for | |
171 | @c 5.0, @c 1200 for @c 6.0 and so on. For convenience, the symbols | |
172 | __VISUALCn__ are also defined for each major compiler version from | |
5c892f57 | 173 | 5 to 10, i.e. you can use tests such @ifdef_ __VISUALC7__ to test |
928f1a07 FM |
174 | for compiler version being precisely 7.} |
175 | @itemdef{__XLC__, AIX compiler} | |
176 | @itemdef{__WATCOMC__, Watcom C++. The value of this macro corresponds to | |
177 | the compiler version, @c 1100 is @c 11.0 and @c 1200 is OpenWatcom.} | |
928f1a07 FM |
178 | @endDefList |
179 | ||
180 | ||
181 | ||
182 | @section page_cppconst_featuretests Feature tests | |
183 | ||
184 | Some library features may not be always available even if they were selected | |
185 | by the user. To make it possible to check if this is the case, the library | |
186 | predefines the symbols in the form @c wxHAS_FEATURE. Unlike | |
187 | @c wxUSE_FEATURE symbols which are defined by the library user (directly | |
188 | in @c setup.h or by running configure script) and which must be always | |
e2742bd6 | 189 | defined as either 0 or 1, the @c wxHAS symbols are only defined if |
928f1a07 FM |
190 | the corresponding feature is available and not defined at all otherwise. |
191 | ||
192 | Currently the following symbols exist: | |
193 | ||
194 | @beginDefList | |
817b7b0e VZ |
195 | @itemdef{wxHAS_3STATE_CHECKBOX, Defined if wxCheckBox supports wxCHK_3STATE |
196 | flag, i.e. is capable of showing three states and not only the usual two. | |
197 | Currently defined for almost all ports.} | |
42124e68 VZ |
198 | @itemdef{wxHAS_ATOMIC_OPS, Defined if wxAtomicInc() and wxAtomicDec() functions |
199 | have an efficient (CPU-specific) implementation. Notice that the functions | |
200 | themselves are always available but can be prohibitively slow to use when | |
201 | implemented in a generic way, using a critical section.} | |
323d36e4 VZ |
202 | @itemdef{wxHAS_BITMAPTOGGLEBUTTON, Defined in @c wx/tglbtn.h if |
203 | wxBitmapToggleButton class is available in addition to wxToggleButton.} | |
f9bb777f VZ |
204 | @itemdef{wxHAS_CONFIG_TEMPLATE_RW, Defined if the currently used compiler |
205 | supports template Read() and Write() methods in wxConfig.} | |
68fe70ea VZ |
206 | @itemdef{wxHAS_LARGE_FILES, Defined if wxFile supports files more than 4GB in |
207 | size (notice that you must include @c wx/filefn.h before testing for this | |
208 | symbol).} | |
209 | @itemdef{wxHAS_LARGE_FFILES, Defined if wxFFile supports files more than 4GB in | |
210 | size (notice that you must include @c wx/filefn.h before testing for this | |
211 | symbol).} | |
066e5e3f VZ |
212 | @itemdef{wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG, Defined if compiler supports a |
213 | 64 bit integer type (available as @c wxLongLong_t) and this type is | |
214 | different from long. Notice that, provided wxUSE_LONGLONG is not turned | |
215 | off, some 64 bit type is always available to wxWidgets programs and this | |
216 | symbol only indicates a presence of such primitive type. It is useful to | |
217 | decide whether some function should be overloaded for both | |
218 | <code>long</code> and <code>long long</code> types.} | |
26078494 | 219 | @itemdef{wxHAS_MULTIPLE_FILEDLG_FILTERS, Defined if wxFileDialog supports multiple ('|'-separated) filters.} |
928f1a07 FM |
220 | @itemdef{wxHAS_POWER_EVENTS, Defined if wxPowerEvent are ever generated on the current platform.} |
221 | @itemdef{wxHAS_RADIO_MENU_ITEMS, | |
222 | Defined if the current port supports radio menu items (see wxMenu::AppendRadioItem).} | |
24671bc9 | 223 | @itemdef{wxHAS_RAW_BITMAP, Defined if direct access to bitmap data using the classes in @c wx/rawbmp.h is supported.} |
928f1a07 FM |
224 | @itemdef{wxHAS_RAW_KEY_CODES, Defined if raw key codes (see wxKeyEvent::GetRawKeyCode are supported.} |
225 | @itemdef{wxHAS_REGEX_ADVANCED, Defined if advanced syntax is available in wxRegEx.} | |
226 | @itemdef{wxHAS_TASK_BAR_ICON, Defined if wxTaskBarIcon is available on the current platform.} | |
227 | @endDefList | |
228 | ||
229 | ||
230 | ||
3fb26cf2 VZ |
231 | @section page_cppconst_msvc_setup_h Libraries selection for MSVC setup.h |
232 | ||
233 | Microsoft Visual C++ users may use the special @c wx/setup.h file for this | |
234 | compiler in @c include/msvc subdirectory. This file implicitly links in all the | |
235 | wxWidgets libraries using MSVC-specific pragmas which usually is much more | |
236 | convenient than manually specifying the libraries list in all of the project | |
237 | configurations. However sometimes linking with all the libraries is not | |
238 | desirable, for example because some of them were not built and this is where | |
239 | the symbols in this section can be helpful: defining them allows to not link | |
240 | with the corresponding library. The following symbols are honoured: | |
241 | - wxNO_ADV_LIB | |
242 | - wxNO_AUI_LIB | |
243 | - wxNO_HTML_LIB | |
244 | - wxNO_MEDIA_LIB | |
245 | - wxNO_NET_LIB | |
1c4293cb | 246 | - wxNO_PROPGRID_LIB |
3fb26cf2 VZ |
247 | - wxNO_QA_LIB |
248 | - wxNO_RICHTEXT_LIB | |
249 | - wxNO_XML_LIB | |
250 | - wxNO_REGEX_LIB | |
251 | - wxNO_EXPAT_LIB | |
252 | - wxNO_JPEG_LIB | |
253 | - wxNO_PNG_LIB | |
254 | - wxNO_TIFF_LIB | |
255 | - wxNO_ZLIB_LIB | |
256 | ||
257 | Notice that the base library is always included and the core is always included | |
258 | for the GUI applications (i.e. those which don't define @c wxUSE_GUI as 0). | |
259 | ||
260 | ||
928f1a07 FM |
261 | @section page_cppconst_miscellaneous Miscellaneous |
262 | ||
263 | @beginDefList | |
264 | @itemdef{__WXWINDOWS__, | |
265 | always defined in wxWidgets applications, see also wxCHECK_VERSION} | |
ab06470e VZ |
266 | @itemdef{wxDEBUG_LEVEL, defined as 1 by default, may be pre-defined as 0 before |
267 | including wxWidgets headers to disable generation of any code at all | |
268 | for the assertion macros, see @ref overview_debugging} | |
269 | @itemdef{__WXDEBUG__, defined if wxDEBUG_LEVEL is 1 or more, undefined otherwise} | |
928f1a07 | 270 | @itemdef{wxUSE_XXX, |
e2742bd6 | 271 | if defined as 1, feature XXX is active, see the |
928f1a07 FM |
272 | @ref page_wxusedef (the symbols of this form are always defined, |
273 | use @if_ and not @ifdef_ to test for them)} | |
274 | @itemdef{WX_PRECOMP, | |
275 | is defined if precompiled headers (PCH) are in use. In | |
276 | this case, @c wx/wxprec.h includes @c wx/wx.h which, in turn, | |
277 | includes a number of wxWidgets headers thus making it unnecessary to include | |
278 | them explicitly. However if this is not defined, you do need to include them | |
279 | and so the usual idiom which allows to support both cases is to first include | |
280 | @c wx/wxprec.h} and then, inside @ifndef_ WX_PRECOMP, individual | |
281 | headers you need.} | |
282 | @itemdef{_UNICODE and UNICODE, both are defined if wxUSE_UNICODE is set to @c 1} | |
283 | @itemdef{wxUSE_GUI, | |
e2742bd6 | 284 | this particular feature test macro is defined to 1 |
928f1a07 FM |
285 | when compiling or using the library with the GUI features activated, |
286 | if it is defined as @c 0, only wxBase is available.} | |
287 | @itemdef{wxUSE_BASE, | |
e2742bd6 | 288 | only used by wxWidgets internally (defined as 1 when |
928f1a07 | 289 | building wxBase code, either as a standalone library or as part of the |
e2742bd6 | 290 | monolithic wxWidgets library, defined as 0 when building GUI library only)} |
928f1a07 FM |
291 | @itemdef{wxNO_RTTI, is defined if the compiler RTTI support has been switched off} |
292 | @itemdef{wxNO_EXCEPTIONS, | |
293 | is defined if the compiler support for C++ exceptions has been switched off} | |
294 | @itemdef{wxNO_THREADS, | |
295 | if this macro is defined, the compilation options | |
296 | don't include compiler flags needed for multithreaded code generation. This | |
e2742bd6 | 297 | implies that wxUSE_THREADS is 0 and also that other (non-wx-based) threading |
928f1a07 FM |
298 | packages cannot be used neither.} |
299 | @itemdef{WXMAKINGDLL_XXX, | |
300 | used internally and defined when building the | |
301 | library @c XXX as a DLL; when a monolithic wxWidgets build is used only a | |
302 | single @c WXMAKINGDLL symbol is defined} | |
303 | @itemdef{WXUSINGDLL, | |
304 | defined when compiling code which uses wxWidgets as a DLL/shared library} | |
305 | @itemdef{WXBUILDING, | |
306 | defined when building wxWidgets itself, whether as a static or shared library} | |
9a83f860 VZ |
307 | @itemdef{wxNO_T, |
308 | may be predefined to prevent the library from defining _T() macro} | |
928f1a07 | 309 | @endDefList |
4514447c FM |
310 | |
311 | */ |