]>
Commit | Line | Data |
---|---|---|
cb7d7375 WS |
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
2 | %% Name: cppconst.tex | |
a4acaafa VZ |
3 | %% Purpose: Preprocessor symbols |
4 | %% Author: Vadim Zeitlin | |
5 | %% Created: 2002-08-22 | |
cb7d7375 | 6 | %% RCS-ID: $Id$ |
a4acaafa | 7 | %% Copyright: (c) 2002-2006 wxWidgets |
cb7d7375 WS |
8 | %% License: wxWindows license |
9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
10 | ||
11 | \section{Preprocessor symbols defined by wxWidgets}\label{cppconst} | |
14aea4f9 | 12 | |
dceb1c09 | 13 | These are preprocessor symbols used in the wxWidgets source, grouped |
d80fc6df | 14 | by category (and sorted by alphabetical order inside each category). All of |
dceb1c09 | 15 | these macros except for the \texttt{wxUSE\_XXX} variety is defined if the |
d80fc6df | 16 | corresponding condition is true and undefined if it isn't, so they should be |
dceb1c09 | 17 | always tested using \texttt{#ifdef} and not \texttt{#if}. |
14aea4f9 | 18 | |
a203f6c0 | 19 | \subsection{GUI system}\label{guisystemconst} |
14aea4f9 VZ |
20 | |
21 | \begin{twocollist}\itemsep=0pt | |
22 | \twocolitem{\_\_WINDOWS\_\_}{any Windows, yom may also use \_\_WXMSW\_\_} | |
fc2171bd | 23 | \twocolitem{\_\_WIN16\_\_}{Win16 API (not supported since wxWidgets 2.6)} |
14aea4f9 | 24 | \twocolitem{\_\_WIN32\_\_}{Win32 API} |
d80fc6df VZ |
25 | \twocolitem{\_\_WXBASE\_\_}{Only wxBase, no GUI features (same as \texttt{wxUSE\_GUI} $== 0$)} |
26 | \twocolitem{\_\_WXCOCOA\_\_}{OS X using Cocoa API} | |
69a126b0 JS |
27 | \twocolitem{\_\_WXWINCE\_\_}{Windows CE} |
28 | \twocolitem{\_\_WXGTK\_\_}{GTK+} | |
29 | \twocolitem{\_\_WXGTK12\_\_}{GTK+ 1.2 or higher} | |
30 | \twocolitem{\_\_WXGTK20\_\_}{GTK+ 2.0 or higher} | |
14aea4f9 | 31 | \twocolitem{\_\_WXMOTIF\_\_}{Motif} |
65ed0182 | 32 | \twocolitem{\_\_WXMOTIF20\_\_}{Motif 2.0 or higher} |
73e54eb4 SC |
33 | \twocolitem{\_\_WXMAC\_\_}{Mac OS all targets} |
34 | \twocolitem{\_\_WXMAC\_CLASSIC\_\_}{MacOS for Classic} | |
35 | \twocolitem{\_\_WXMAC\_CARBON\_\_}{MacOS for Carbon CFM (running under Classic or OSX) or true OS X Mach-O Builds} | |
d80fc6df | 36 | \twocolitem{\_\_WXMAC\_OSX\_\_}{MacOS X Carbon Mach-O Builds} |
14aea4f9 VZ |
37 | \twocolitem{\_\_WXMGL\_\_}{SciTech Soft MGL (\_\_WXUNIVERSAL\_\_ will be also |
38 | defined)} | |
39 | \twocolitem{\_\_WXMSW\_\_}{Any Windows} | |
d80fc6df | 40 | \twocolitem{\_\_WXOSX\_\_}{Any Mac OS X port (either Carbon or Cocoa)} |
8e1bf704 | 41 | \twocolitem{\_\_WXPALMOS\_\_}{PalmOS} |
14aea4f9 VZ |
42 | \twocolitem{\_\_WXPM\_\_}{OS/2 native Presentation Manager} |
43 | \twocolitem{\_\_WXSTUBS\_\_}{Stubbed version ('template' wxWin implementation)} | |
44 | \twocolitem{\_\_WXXT\_\_}{Xt; mutually exclusive with WX\_MOTIF, not | |
fc2171bd | 45 | implemented in wxWidgets 2.x} |
14aea4f9 | 46 | \twocolitem{\_\_WXX11\_\_}{wxX11 (\_\_WXUNIVERSAL\_\_ will be also defined)} |
69a126b0 | 47 | \twocolitem{\_\_WXWINE\_\_}{WINE (i.e. WIN32 on Unix)} |
14aea4f9 VZ |
48 | \twocolitem{\_\_WXUNIVERSAL\_\_}{wxUniversal port, always defined in addition |
49 | to one of the symbols above so this should be tested first.} | |
50 | \twocolitem{\_\_X\_\_}{any X11-based GUI toolkit except GTK+} | |
51 | \end{twocollist} | |
52 | ||
9ceeecb9 | 53 | There are two wxWidgets ports to Mac OS. One of them, wxMac, exists in two versions: Classic and |
d80fc6df VZ |
54 | Carbon. The Classic version is the only one to work on Mac OS version 8. The |
55 | Carbon version may be built either as CFM or Mach-O (binary format, like ELF) | |
56 | and the former may run under OS 9 while the latter only runs under OS X. | |
57 | Finally, there is a new Cocoa port which can only be used under OS X. To | |
58 | summarize: | |
9ceeecb9 | 59 | |
d80fc6df | 60 | \begin{itemize} |
9ceeecb9 JS |
61 | \item If you want to test for all Mac platforms, classic and OS X, you |
62 | should test both \texttt{\_\_WXMAC\_\_} and \texttt{\_\_WXCOCOA\_\_}. | |
cb7d7375 | 63 | \item If you want to test for any GUI Mac port under OS X, use |
9ceeecb9 JS |
64 | \texttt{\_\_WXOSX\_\_}. |
65 | \item If you want to test for any port under Mac OS X, including, for | |
66 | example, wxGTK and also wxBase, use \texttt{\_\_DARWIN\_\_} (see below). | |
d80fc6df VZ |
67 | \end{itemize} |
68 | ||
9ceeecb9 JS |
69 | The convention is to use the \texttt{\_\_WX} prefix for these |
70 | symbols, although this has not always been followed. | |
14aea4f9 | 71 | |
a203f6c0 | 72 | \subsection{Operating systems}\label{osconst} |
14aea4f9 VZ |
73 | |
74 | \begin{twocollist}\itemsep=0pt | |
75 | \twocolitem{\_\_APPLE\_\_}{any Mac OS version} | |
76 | \twocolitem{\_\_AIX\_\_}{AIX} | |
77 | \twocolitem{\_\_BSD\_\_}{Any *BSD system} | |
78 | \twocolitem{\_\_CYGWIN\_\_}{Cygwin: Unix on Win32} | |
0211e0d5 | 79 | \twocolitem{\_\_DARWIN\_\_}{Mac OS X using the BSD Unix C library (as opposed to using the Metrowerks MSL C/C++ library)} |
14aea4f9 VZ |
80 | \twocolitem{\_\_DATA\_GENERAL\_\_}{DG-UX} |
81 | \twocolitem{\_\_DOS\_GENERAL\_\_}{DOS (used with wxMGL only)} | |
82 | \twocolitem{\_\_FREEBSD\_\_}{FreeBSD} | |
83 | \twocolitem{\_\_HPUX\_\_}{HP-UX (Unix)} | |
e2478fde | 84 | \twocolitem{\_\_GNU\_\_}{GNU Hurd} |
14aea4f9 | 85 | \twocolitem{\_\_LINUX\_\_}{Linux} |
ab83849c | 86 | \twocolitem{\_\_MACH\_\_}{Mach-O Architecture (Mac OS X only builds)} |
14aea4f9 | 87 | \twocolitem{\_\_OSF\_\_}{OSF/1} |
8e1bf704 | 88 | \twocolitem{\_\_PALMOS\_\_}{PalmOS} |
14aea4f9 VZ |
89 | \twocolitem{\_\_SGI\_\_}{IRIX} |
90 | \twocolitem{\_\_SOLARIS\_\_}{Solaris} | |
91 | \twocolitem{\_\_SUN\_\_}{Any Sun} | |
92 | \twocolitem{\_\_SUNOS\_\_}{Sun OS} | |
93 | \twocolitem{\_\_SVR4\_\_}{SystemV R4} | |
94 | \twocolitem{\_\_SYSV\_\_}{SystemV generic} | |
95 | \twocolitem{\_\_ULTRIX\_\_}{Ultrix} | |
96 | \twocolitem{\_\_UNIX\_\_}{any Unix} | |
97 | \twocolitem{\_\_UNIX\_LIKE\_\_}{Unix, BeOS or VMS} | |
98 | \twocolitem{\_\_VMS\_\_}{VMS} | |
99 | \twocolitem{\_\_WINDOWS\_\_}{any Windows} | |
d92c8cd9 | 100 | \twocolitem{\_\_WINE\_\_}{Wine} |
14aea4f9 VZ |
101 | \end{twocollist} |
102 | ||
d80fc6df | 103 | |
57ff58bd | 104 | \subsection{Hardware architectures (CPU)}\label{cpuconst} |
14aea4f9 VZ |
105 | |
106 | Note that not all of these symbols are always defined, it depends on the | |
107 | compiler used. | |
108 | ||
109 | \begin{twocollist}\itemsep=0pt | |
110 | \twocolitem{\_\_ALPHA\_\_}{DEC Alpha architecture} | |
111 | \twocolitem{\_\_INTEL\_\_}{Intel i386 or compatible} | |
748a4684 | 112 | \twocolitem{\_\_IA64\_\_}{Intel 64 bit architecture} |
14aea4f9 VZ |
113 | \twocolitem{\_\_POWERPC\_\_}{Motorola Power PC} |
114 | \end{twocollist} | |
115 | ||
d80fc6df | 116 | |
57ff58bd WS |
117 | \subsection{Hardware type}\label{hardwareconst} |
118 | ||
57ff58bd | 119 | \begin{twocollist}\itemsep=0pt |
b669780b JS |
120 | \twocolitem{\_\_SMARTPHONE\_\_}{Generic mobile devices with phone buttons and a small display} |
121 | \twocolitem{\_\_PDA\_\_}{Personal digital assistant, usually with touch screen} | |
122 | \twocolitem{\_\_HANDHELD\_\_}{Small but powerful computer, usually with a keyboard} | |
9ceeecb9 JS |
123 | \twocolitem{\_\_POCKETPC\_\_}{Microsoft-powered PocketPC devices with touch-screen} |
124 | \twocolitem{\_\_WINCE\_STANDARDSDK\_\_}{Microsoft-powered Windows CE devices, for generic Windows CE applications} | |
125 | \twocolitem{\_\_WINCE\_NET\_\_}{Microsoft-powered Windows CE .NET devices (\_WIN32\_WCE is 400 or greater)} | |
b669780b | 126 | \twocolitem{WIN32\_PLATFORM\_WFSP}{Microsoft-powered smartphone} |
57ff58bd WS |
127 | \end{twocollist} |
128 | ||
d80fc6df | 129 | |
a203f6c0 | 130 | \subsection{Compilers}\label{compilerconst} |
14aea4f9 VZ |
131 | |
132 | \begin{twocollist}\itemsep=0pt | |
14347204 VZ |
133 | \twocolitem{\_\_BORLANDC\_\_}{Borland C++. The value of the macro corresponds |
134 | to the compiler version: $500$ is $5.0$.} | |
14aea4f9 | 135 | \twocolitem{\_\_DJGPP\_\_}{DJGPP} |
69a126b0 | 136 | \twocolitem{\_\_DIGITALMARS\_\_}{Digital Mars} |
cb7d7375 | 137 | \twocolitem{\_\_GNUG\_\_}{Gnu C++ on any platform, see also |
14347204 | 138 | \helpref{wxCHECK\_GCC\_VERSION}{wxcheckgccversion}} |
cb7d7375 | 139 | \twocolitem{\_\_GNUWIN32\_\_}{Gnu-Win32 compiler, see also |
14347204 | 140 | \helpref{wxCHECK\_W32API\_VERSION}{wxcheckw32apiversion}} |
69a126b0 | 141 | \twocolitem{\_\_MINGW32\_\_}{MinGW} |
14aea4f9 VZ |
142 | \twocolitem{\_\_MWERKS\_\_}{CodeWarrior MetroWerks compiler} |
143 | \twocolitem{\_\_SUNCC\_\_}{Sun CC} | |
144 | \twocolitem{\_\_SYMANTECC\_\_}{Symantec C++} | |
145 | \twocolitem{\_\_VISAGECPP\_\_}{IBM Visual Age (OS/2)} | |
14347204 VZ |
146 | \twocolitem{\_\_VISUALC\_\_}{Microsoft Visual C++. The value of this macro |
147 | corresponds to the compiler version: $1020$ for $4.2$ (the first supported | |
148 | version), $1100$ for $5.0$, $1200$ for $6.0$ and so on} | |
14aea4f9 | 149 | \twocolitem{\_\_XLC\_\_}{AIX compiler} |
14347204 VZ |
150 | \twocolitem{\_\_WATCOMC\_\_}{Watcom C++. The value of this macro corresponds to |
151 | the compiler version, $1100$ is $11.0$ and $1200$ is OpenWatcom.} | |
69a126b0 | 152 | \twocolitem{\_WIN32\_WCE}{Windows CE version} |
14aea4f9 VZ |
153 | \end{twocollist} |
154 | ||
d80fc6df | 155 | |
a4acaafa VZ |
156 | \subsection{Feature tests}\label{featuretests} |
157 | ||
158 | Some library features may not be always available even if they were selected by | |
159 | the user. To make it possible to check if this is the case, the library | |
160 | predefines the symbols in the form \texttt{wxHAS\_FEATURE}. Unlike | |
161 | \texttt{wxUSE\_FEATURE} symbols which are defined by the library user (directly | |
162 | in \texttt{setup.h} or by running configure script) and which must be always | |
163 | defined as either $0$ or $1$, the \texttt{wxHAS} symbols are only defined if | |
164 | the corresponding feature is available and not defined at all otherwise. | |
165 | ||
166 | Currently the following symbols exist: | |
167 | \begin{twocollist}\itemsep=0pt | |
168 | \twocolitem{wxHAS\_LARGE\_FILES}{Defined if \helpref{wxFile}{wxfile} supports | |
169 | files more than 4GB in size.} | |
170 | \twocolitem{wxHAS\_LARGE\_FFILES}{Defined if \helpref{wxFFile}{wxffile} | |
171 | supports files more than 4GB in size.} | |
172 | \twocolitem{wxHAS\_POWER\_EVENTS}{Defined if | |
173 | \helpref{wxPowerEvent}{wxpowerevent} are ever generated on the current platform.} | |
174 | \twocolitem{wxHAS\_RADIO\_MENU\_ITEMS}{Defined if the current port supports | |
175 | \helpref{radio menu items}{wxmenuappendradioitem}.} | |
176 | \twocolitem{wxHAS\_RAW\_KEY\_CODES}{Defined if | |
177 | \helpref{raw key codes}{wxkeyeventgetrawkeycode} are supported.} | |
178 | \twocolitem{wxHAS\_REGEX\_ADVANCED}{Defined if advanced syntax is available in | |
179 | \helpref{wxRegEx}{wxregex}.} | |
180 | \twocolitem{wxHAS\_TASK\_BAR\_ICON}{Defined if | |
181 | \helpref{wxTaskBarIcon}{wxtaskbaricon} is available on the current platform.} | |
182 | \end{twocollist} | |
183 | ||
184 | ||
a203f6c0 | 185 | \subsection{Miscellaneous}\label{miscellaneousconst} |
14aea4f9 VZ |
186 | |
187 | \begin{twocollist}\itemsep=0pt | |
fc2171bd | 188 | \twocolitem{\_\_WXWINDOWS\_\_}{always defined in wxWidgets applications, see |
e2478fde | 189 | also \helpref{wxCHECK\_VERSION}{wxcheckversion}} |
14aea4f9 VZ |
190 | \twocolitem{\_\_WXDEBUG\_\_}{defined in debug mode, undefined in release mode} |
191 | \twocolitem{wxUSE\_XXX}{if defined as $1$, feature XXX is active | |
bf43ff9a | 192 | (the symbols of this form are always defined, use \#if and not \#ifdef to test |
14aea4f9 | 193 | for them)} |
d5df6918 VZ |
194 | \twocolitem{WX\_PRECOMP}{is defined if precompiled headers (PCH) are in use. In |
195 | this case, \texttt{wx/wxprec.h} includes \texttt{wx/wx.h} which, in turn, | |
196 | includes a number of wxWidgets headers thus making it unnecessary to include | |
197 | them explicitly. However if this is not defined, you do need to include them | |
cb7d7375 | 198 | and so the usual idiom which allows to support both cases is to first include |
d5df6918 VZ |
199 | \texttt{wx/wxprec.h} and then, inside \texttt{#ifndef WX\_PRECOMP}, individual |
200 | headers you need.} | |
b9e34846 | 201 | \twocolitem{\_UNICODE and UNICODE}{both are defined if wxUSE\_UNICODE is set to $1$} |
002568cc VZ |
202 | \twocolitem{wxUSE\_GUI}{this particular feature test macro is defined to $1$ |
203 | when compiling or using the library with the GUI features activated, if it is | |
204 | defined as $0$, only wxBase is available.} | |
fc2171bd | 205 | \twocolitem{wxUSE\_BASE}{only used by wxWidgets internally (defined as $1$ when |
002568cc | 206 | building wxBase code, either as a standalone library or as part of the |
fc2171bd | 207 | monolithic wxWidgets library, defined as $0$ when building GUI library only)} |
78603ad2 VZ |
208 | \twocolitem{wxNO\_RTTI}{is defined if the compiler RTTI support has been switched off} |
209 | \twocolitem{wxNO\_EXCEPTIONS}{is defined if the compiler support for C++ | |
210 | exceptions has been switched off} | |
211 | \twocolitem{wxNO\_THREADS}{if this macro is defined, the compilation options | |
212 | don't include compiler flags needed for multithreaded code generation. This | |
154b6b0f | 213 | implies that wxUSE\_THREADS is $0$ and also that other (non-wx-based) threading |
78603ad2 | 214 | packages cannot be used neither.} |
14aea4f9 | 215 | \end{twocollist} |