9250cdb9e616935a6f84a36e2ffea4edf2558da6
[gcc.git] / libstdc++-v3 / doc / html / manual / using_macros.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Macros</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_namespaces.html" title="Namespaces" /><link rel="next" href="using_concurrency.html" title="Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.macros"></a>Macros</h2></div></div></div><p>All pre-processor switches and configurations are all gathered
4 in the file <code class="code">c++config.h</code>, which is generated during
5 the libstdc++ configuration and build process, and included by
6 files part of the public libstdc++ API. Most of these macros
7 should not be used by consumers of libstdc++, and are reserved
8 for internal implementation use. <span class="emphasis"><em>These macros cannot be
9 redefined</em></span>. However, a select handful of these macro
10 control libstdc++ extensions and extra features, or provide
11 versioning information for the API, and are able to be used.
12 </p><p>All library macros begin with <code class="code">_GLIBCXX_</code> (except for
13 versions 3.1.x to 3.3.x, which use <code class="code">_GLIBCPP_</code>).
14 </p><p>Below is the macro which users may check for library version
15 information. </p><div class="variablelist"><dl><dt><span class="term"><code class="code">__GLIBCXX__</code></span></dt><dd><p>The current version of
16 libstdc++ in compressed ISO date format, form of an unsigned
17 long. For details on the value of this particular macro for a
18 particular release, please consult this <a class="ulink" href="abi.html" target="_top">
19 document</a>.
20 </p></dd></dl></div><p>Below are the macros which users may change with #define/#undef or
21 with -D/-U compiler flags. The default state of the symbol is
22 listed.</p><p><span class="quote">Configurable</span>” (or “<span class="quote">Not configurable</span>”) means
23 that the symbol is initially chosen (or not) based on
24 --enable/--disable options at library build and configure time
25 (documented <a class="link" href="configure.html" title="Configure">here</a>), with the
26 various --enable/--disable choices being translated to
27 #define/#undef).
28 </p><p> <acronym class="acronym">ABI</acronym> means that changing from the default value may
29 mean changing the <acronym class="acronym">ABI</acronym> of compiled code. In other words, these
30 choices control code which has already been compiled (i.e., in a
31 binary such as libstdc++.a/.so). If you explicitly #define or
32 #undef these macros, the <span class="emphasis"><em>headers</em></span> may see different code
33 paths, but the <span class="emphasis"><em>libraries</em></span> which you link against will not.
34 Experimenting with different values with the expectation of
35 consistent linkage requires changing the config headers before
36 building/installing the library.
37 </p><div class="variablelist"><dl><dt><span class="term"><code class="code">_GLIBCXX_DEPRECATED</code></span></dt><dd><p>
38 Defined by default. Not configurable. ABI-changing. Turning this off
39 removes older ARM-style iostreams code, and other anachronisms
40 from the API. This macro is dependent on the version of the
41 standard being tracked, and as a result may give different results for
42 <code class="code">-std=c++98</code> and <code class="code">-std=c++0x</code>. This may
43 be useful in updating old C++ code which no longer meet the
44 requirements of the language, or for checking current code
45 against new language standards.
46 </p></dd><dt><span class="term"><code class="code">_GLIBCXX_FORCE_NEW</code></span></dt><dd><p>
47 Undefined by default. When defined, memory allocation and
48 allocators controlled by libstdc++ call operator new/delete
49 without caching and pooling. Configurable via
50 <code class="code">--enable-libstdcxx-allocator</code>. ABI-changing.
51 </p></dd><dt><span class="term"><code class="code">_GLIBCXX_CONCEPT_CHECKS</code></span></dt><dd><p>
52 Undefined by default. Configurable via
53 <code class="code">--enable-concept-checks</code>. When defined, performs
54 compile-time checking on certain template instantiations to
55 detect violations of the requirements of the standard. This
56 is described in more detail <a class="ulink" href="../19_diagnostics/howto.html#3" target="_top">here</a>.
57 </p></dd><dt><span class="term"><code class="code">_GLIBCXX_DEBUG</code></span></dt><dd><p>
58 Undefined by default. When defined, compiles user code using
59 the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>.
60 </p></dd><dt><span class="term"><code class="code">_GLIBCXX_DEBUG_PEDANTIC</code></span></dt><dd><p>
61 Undefined by default. When defined while compiling with
62 the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>, makes
63 the debug mode extremely picky by making the use of libstdc++
64 extensions and libstdc++-specific behavior into errors.
65 </p></dd><dt><span class="term"><code class="code">_GLIBCXX_PARALLEL</code></span></dt><dd><p>Undefined by default. When defined, compiles user code
66 using the <a class="link" href="parallel_mode.html" title="Chapter 31. Parallel Mode">parallel
67 mode</a>.
68 </p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_namespaces.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Namespaces </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Concurrency</td></tr></table></div></body></html>