]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/cppconst.tex
Provide a wxDirSelectorPromptStr
[wxWidgets.git] / docs / latex / wx / cppconst.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: cppconst.tex
3%% Purpose: Peprocessor symbols
4%% Author:
5%% Modified by:
6%% Created:
7%% RCS-ID: $Id$
8%% Copyright: (c) wxWidgets
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{Preprocessor symbols defined by wxWidgets}\label{cppconst}
13
14These are preprocessor symbols used in the wxWidgets source, grouped
15by category (and sorted by alphabetical order inside each category). All of
16these macros except for the \texttt{wxUSE\_XXX} variety is defined if the
17corresponding condition is true and undefined if it isn't, so they should be
18always tested using \texttt{#ifdef} and not \texttt{#if}.
19
20\subsection{GUI system}\label{guisystemconst}
21
22\begin{twocollist}\itemsep=0pt
23\twocolitem{\_\_WINDOWS\_\_}{any Windows, yom may also use \_\_WXMSW\_\_}
24\twocolitem{\_\_WIN16\_\_}{Win16 API (not supported since wxWidgets 2.6)}
25\twocolitem{\_\_WIN32\_\_}{Win32 API}
26\twocolitem{\_\_WXBASE\_\_}{Only wxBase, no GUI features (same as \texttt{wxUSE\_GUI} $== 0$)}
27\twocolitem{\_\_WXCOCOA\_\_}{OS X using Cocoa API}
28\twocolitem{\_\_WXWINCE\_\_}{Windows CE}
29\twocolitem{\_\_WXGTK\_\_}{GTK+}
30\twocolitem{\_\_WXGTK12\_\_}{GTK+ 1.2 or higher}
31\twocolitem{\_\_WXGTK20\_\_}{GTK+ 2.0 or higher}
32\twocolitem{\_\_WXMOTIF\_\_}{Motif}
33\twocolitem{\_\_WXMOTIF20\_\_}{Motif 2.0 or higher}
34\twocolitem{\_\_WXMAC\_\_}{Mac OS all targets}
35\twocolitem{\_\_WXMAC\_CLASSIC\_\_}{MacOS for Classic}
36\twocolitem{\_\_WXMAC\_CARBON\_\_}{MacOS for Carbon CFM (running under Classic or OSX) or true OS X Mach-O Builds}
37\twocolitem{\_\_WXMAC\_OSX\_\_}{MacOS X Carbon Mach-O Builds}
38\twocolitem{\_\_WXMGL\_\_}{SciTech Soft MGL (\_\_WXUNIVERSAL\_\_ will be also
39defined)}
40\twocolitem{\_\_WXMSW\_\_}{Any Windows}
41\twocolitem{\_\_WXOSX\_\_}{Any Mac OS X port (either Carbon or Cocoa)}
42\twocolitem{\_\_WXPALMOS\_\_}{PalmOS}
43\twocolitem{\_\_WXPM\_\_}{OS/2 native Presentation Manager}
44\twocolitem{\_\_WXSTUBS\_\_}{Stubbed version ('template' wxWin implementation)}
45\twocolitem{\_\_WXXT\_\_}{Xt; mutually exclusive with WX\_MOTIF, not
46implemented in wxWidgets 2.x}
47\twocolitem{\_\_WXX11\_\_}{wxX11 (\_\_WXUNIVERSAL\_\_ will be also defined)}
48\twocolitem{\_\_WXWINE\_\_}{WINE (i.e. WIN32 on Unix)}
49\twocolitem{\_\_WXUNIVERSAL\_\_}{wxUniversal port, always defined in addition
50to one of the symbols above so this should be tested first.}
51\twocolitem{\_\_X\_\_}{any X11-based GUI toolkit except GTK+}
52\end{twocollist}
53
54There are two wxWidgets ports to Mac OS. One of them, wxMac, exists in two versions: Classic and
55Carbon. The Classic version is the only one to work on Mac OS version 8. The
56Carbon version may be built either as CFM or Mach-O (binary format, like ELF)
57and the former may run under OS 9 while the latter only runs under OS X.
58Finally, there is a new Cocoa port which can only be used under OS X. To
59summarize:
60
61\begin{itemize}
62\item If you want to test for all Mac platforms, classic and OS X, you
63should test both \texttt{\_\_WXMAC\_\_} and \texttt{\_\_WXCOCOA\_\_}.
64\item If you want to test for any GUI Mac port under OS X, use
65\texttt{\_\_WXOSX\_\_}.
66\item If you want to test for any port under Mac OS X, including, for
67example, wxGTK and also wxBase, use \texttt{\_\_DARWIN\_\_} (see below).
68\end{itemize}
69
70The convention is to use the \texttt{\_\_WX} prefix for these
71symbols, although this has not always been followed.
72
73\subsection{Operating systems}\label{osconst}
74
75\begin{twocollist}\itemsep=0pt
76\twocolitem{\_\_APPLE\_\_}{any Mac OS version}
77\twocolitem{\_\_AIX\_\_}{AIX}
78\twocolitem{\_\_BSD\_\_}{Any *BSD system}
79\twocolitem{\_\_CYGWIN\_\_}{Cygwin: Unix on Win32}
80\twocolitem{\_\_DARWIN\_\_}{Mac OS X using the BSD Unix C library (as opposed to using the Metrowerks MSL C/C++ library)}
81\twocolitem{\_\_DATA\_GENERAL\_\_}{DG-UX}
82\twocolitem{\_\_DOS\_GENERAL\_\_}{DOS (used with wxMGL only)}
83\twocolitem{\_\_FREEBSD\_\_}{FreeBSD}
84\twocolitem{\_\_HPUX\_\_}{HP-UX (Unix)}
85\twocolitem{\_\_GNU\_\_}{GNU Hurd}
86\twocolitem{\_\_LINUX\_\_}{Linux}
87\twocolitem{\_\_MACH\_\_}{Mach-O Architecture (Mac OS X only builds)}
88\twocolitem{\_\_OSF\_\_}{OSF/1}
89\twocolitem{\_\_PALMOS\_\_}{PalmOS}
90\twocolitem{\_\_SGI\_\_}{IRIX}
91\twocolitem{\_\_SOLARIS\_\_}{Solaris}
92\twocolitem{\_\_SUN\_\_}{Any Sun}
93\twocolitem{\_\_SUNOS\_\_}{Sun OS}
94\twocolitem{\_\_SVR4\_\_}{SystemV R4}
95\twocolitem{\_\_SYSV\_\_}{SystemV generic}
96\twocolitem{\_\_ULTRIX\_\_}{Ultrix}
97\twocolitem{\_\_UNIX\_\_}{any Unix}
98\twocolitem{\_\_UNIX\_LIKE\_\_}{Unix, BeOS or VMS}
99\twocolitem{\_\_VMS\_\_}{VMS}
100\twocolitem{\_\_WINDOWS\_\_}{any Windows}
101\end{twocollist}
102
103
104\subsection{Hardware architectures (CPU)}\label{cpuconst}
105
106Note that not all of these symbols are always defined, it depends on the
107compiler used.
108
109\begin{twocollist}\itemsep=0pt
110\twocolitem{\_\_ALPHA\_\_}{DEC Alpha architecture}
111\twocolitem{\_\_INTEL\_\_}{Intel i386 or compatible}
112\twocolitem{\_\_IA64\_\_}{Intel 64 bit architecture}
113\twocolitem{\_\_POWERPC\_\_}{Motorola Power PC}
114\end{twocollist}
115
116
117\subsection{Hardware type}\label{hardwareconst}
118
119\begin{twocollist}\itemsep=0pt
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}
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)}
126\twocolitem{WIN32\_PLATFORM\_WFSP}{Microsoft-powered smartphone}
127\end{twocollist}
128
129
130\subsection{Compilers}\label{compilerconst}
131
132\begin{twocollist}\itemsep=0pt
133\twocolitem{\_\_BORLANDC\_\_}{Borland C++. The value of the macro corresponds
134to the compiler version: $500$ is $5.0$.}
135\twocolitem{\_\_DJGPP\_\_}{DJGPP}
136\twocolitem{\_\_DIGITALMARS\_\_}{Digital Mars}
137\twocolitem{\_\_GNUG\_\_}{Gnu C++ on any platform, see also
138\helpref{wxCHECK\_GCC\_VERSION}{wxcheckgccversion}}
139\twocolitem{\_\_GNUWIN32\_\_}{Gnu-Win32 compiler, see also
140\helpref{wxCHECK\_W32API\_VERSION}{wxcheckw32apiversion}}
141\twocolitem{\_\_MINGW32\_\_}{MinGW}
142\twocolitem{\_\_MWERKS\_\_}{CodeWarrior MetroWerks compiler}
143\twocolitem{\_\_SUNCC\_\_}{Sun CC}
144\twocolitem{\_\_SYMANTECC\_\_}{Symantec C++}
145\twocolitem{\_\_VISAGECPP\_\_}{IBM Visual Age (OS/2)}
146\twocolitem{\_\_VISUALC\_\_}{Microsoft Visual C++. The value of this macro
147corresponds to the compiler version: $1020$ for $4.2$ (the first supported
148version), $1100$ for $5.0$, $1200$ for $6.0$ and so on}
149\twocolitem{\_\_XLC\_\_}{AIX compiler}
150\twocolitem{\_\_WATCOMC\_\_}{Watcom C++. The value of this macro corresponds to
151the compiler version, $1100$ is $11.0$ and $1200$ is OpenWatcom.}
152\twocolitem{\_WIN32\_WCE}{Windows CE version}
153\end{twocollist}
154
155
156\subsection{Miscellaneous}\label{miscellaneousconst}
157
158\begin{twocollist}\itemsep=0pt
159\twocolitem{\_\_WXWINDOWS\_\_}{always defined in wxWidgets applications, see
160also \helpref{wxCHECK\_VERSION}{wxcheckversion}}
161\twocolitem{\_\_WXDEBUG\_\_}{defined in debug mode, undefined in release mode}
162\twocolitem{wxUSE\_XXX}{if defined as $1$, feature XXX is active
163(the symbols of this form are always defined, use \#if and not \#ifdef to test
164 for them)}
165\twocolitem{WX\_PRECOMP}{is defined if precompiled headers (PCH) are in use. In
166this case, \texttt{wx/wxprec.h} includes \texttt{wx/wx.h} which, in turn,
167includes a number of wxWidgets headers thus making it unnecessary to include
168them explicitly. However if this is not defined, you do need to include them
169and so the usual idiom which allows to support both cases is to first include
170\texttt{wx/wxprec.h} and then, inside \texttt{#ifndef WX\_PRECOMP}, individual
171headers you need.}
172\twocolitem{\_UNICODE and UNICODE}{both are defined if wxUSE\_UNICODE is set to $1$}
173\twocolitem{wxUSE\_GUI}{this particular feature test macro is defined to $1$
174when compiling or using the library with the GUI features activated, if it is
175defined as $0$, only wxBase is available.}
176\twocolitem{wxUSE\_BASE}{only used by wxWidgets internally (defined as $1$ when
177building wxBase code, either as a standalone library or as part of the
178monolithic wxWidgets library, defined as $0$ when building GUI library only)}
179\twocolitem{wxNO\_RTTI}{is defined if the compiler RTTI support has been switched off}
180\twocolitem{wxNO\_EXCEPTIONS}{is defined if the compiler support for C++
181exceptions has been switched off}
182\twocolitem{wxNO\_THREADS}{if this macro is defined, the compilation options
183don't include compiler flags needed for multithreaded code generation. This
184implies that wxUSE\_THREADS is $0$ and also that other (non-wx-based) threading
185packages cannot be used neither.}
186\end{twocollist}