Commit a138d52a by Jonathan Wakely Committed by Jonathan Wakely

Add _GLIBCXX_RELEASE macro to "Using" section of manual

	* doc/xml/manual/abi.xml: Add xml:id anchor.
	* doc/xml/manual/using.xml (manual.intro.using.macros): Document
	_GLIBCXX_RELEASE. Link to new anchor for __GLIBCXX__ notes.
	(concurrency.io.structure): Add markup.
	* doc/html/*: Regenerate.

From-SVN: r246532
parent c5ad2433
2017-03-28 Jonathan Wakely <jwakely@redhat.com> 2017-03-28 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/abi.xml: Add xml:id anchor.
* doc/xml/manual/using.xml (manual.intro.using.macros): Document
_GLIBCXX_RELEASE. Link to new anchor for __GLIBCXX__ notes.
(concurrency.io.structure): Add markup.
* doc/html/*: Regenerate.
PR libstdc++/80229 PR libstdc++/80229
* include/bits/shared_ptr_base.h * include/bits/shared_ptr_base.h
(__shared_ptr::_M_enable_shared_from_this_with): Change parameters to (__shared_ptr::_M_enable_shared_from_this_with): Change parameters to
......
...@@ -145,7 +145,7 @@ compatible. ...@@ -145,7 +145,7 @@ compatible.
<code class="code">-fabi-version</code>. <code class="code">-fabi-version</code>.
</p><p> </p><p>
It is versioned as follows: It is versioned as follows:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0: (Error, not versioned) </p></li><li class="listitem"><p>GCC 3.1: (Error, not versioned) </p></li><li class="listitem"><p>GCC 3.2: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>GCC 3.3: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>GCC 3.4, GCC 4.x: <code class="code">-fabi-version=2</code> <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 5 and higher: <code class="code">-fabi-version=0</code> <span class="emphasis"><em>(See GCC manual for meaning)</em></span></p></li></ul></div><p></p></li><li class="listitem"><p>Incremental bumping of a library pre-defined macro. For releases </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>GCC 3.0: (Error, not versioned) </p></li><li class="listitem"><p>GCC 3.1: (Error, not versioned) </p></li><li class="listitem"><p>GCC 3.2: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>GCC 3.3: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>GCC 3.4, GCC 4.x: <code class="code">-fabi-version=2</code> <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>GCC 5 and higher: <code class="code">-fabi-version=0</code> <span class="emphasis"><em>(See GCC manual for meaning)</em></span></p></li></ul></div><p></p></li><li class="listitem"><p><a id="abi.versioning.__GLIBCXX__"></a>Incremental bumping of a library pre-defined macro. For releases
before 3.4.0, the macro is <span class="symbol">__GLIBCPP__</span>. For later before 3.4.0, the macro is <span class="symbol">__GLIBCPP__</span>. For later
releases, it's <span class="symbol">__GLIBCXX__</span>. (The libstdc++ project releases, it's <span class="symbol">__GLIBCXX__</span>. (The libstdc++ project
generously changed from CPP to CXX throughout its source to allow the generously changed from CPP to CXX throughout its source to allow the
......
...@@ -180,10 +180,11 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) ...@@ -180,10 +180,11 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
implementations of the C library with varying tradeoffs of threadsafety implementations of the C library with varying tradeoffs of threadsafety
and efficiency. You, the programmer, are always required to take care and efficiency. You, the programmer, are always required to take care
with multiple threads. with multiple threads.
</p><p>(As an example, the POSIX standard requires that C stdio FILE* </p><p>(As an example, the POSIX standard requires that C stdio
operations are atomic. POSIX-conforming C libraries (e.g, on Solaris <code class="code">FILE*</code> operations are atomic. POSIX-conforming C libraries
and GNU/Linux) have an internal mutex to serialize operations on (e.g, on Solaris and GNU/Linux) have an internal mutex to serialize
FILE*s. However, you still need to not do stupid things like calling operations on <code class="code">FILE*</code>s.
However, you still need to not do stupid things like calling
<code class="code">fclose(fs)</code> in one thread followed by an access of <code class="code">fclose(fs)</code> in one thread followed by an access of
<code class="code">fs</code> in another.) <code class="code">fs</code> in another.)
</p><p>So, if your platform's C library is threadsafe, then your </p><p>So, if your platform's C library is threadsafe, then your
......
...@@ -17,13 +17,24 @@ ...@@ -17,13 +17,24 @@
features, or provide versioning information for the API. Only features, or provide versioning information for the API. Only
those macros listed below are offered for consideration by the those macros listed below are offered for consideration by the
general public. general public.
</p><p>Below is the macro which users may check for library version </p><p>Below are the macros which users may check for library version
information. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">__GLIBCXX__</code></span></dt><dd><p>The current version of information. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">_GLIBCXX_RELEASE</code></span></dt><dd><p>The major release number for libstdc++. This macro is defined
libstdc++ in compressed ISO date format, as an unsigned to the GCC major version that the libstdc++ headers belong to,
long. For details on the value of this particular macro for a as an integer constant.
particular release, please consult the <a class="link" href="abi.html" title="ABI Policy and Guidelines"> When compiling with GCC it has the same value as GCC's pre-defined
ABI Policy and Guidelines</a> appendix. macro <span class="symbol">__GNUC__</span>.
</p></dd></dl></div><p>Below are the macros which users may change with #define/#undef or This macro can be used when libstdc++ is used with a non-GNU
compiler where <span class="symbol">__GNUC__</span> is not defined, or has a
different value that doesn't correspond to the libstdc++ version.
This macro first appeared in the GCC 7.1 release and is not defined
for GCC 6.x or older releases.
</p></dd><dt><span class="term"><code class="code">__GLIBCXX__</code></span></dt><dd><p>The revision date of the libstdc++ source code,
in compressed ISO date format, as an unsigned
long. For notes about using this macro and details on the value of
this macro for a particular release, please consult the
<a class="link" href="abi.html#abi.versioning.__GLIBCXX__">ABI History</a>
appendix.
</p></dd></dl></div><p>Below are the macros which users may change with #define/#undef or
with -D/-U compiler flags. The default state of the symbol is with -D/-U compiler flags. The default state of the symbol is
listed.</p><p><span class="quote"><span class="quote">Configurable</span></span> (or <span class="quote"><span class="quote">Not configurable</span></span>) means listed.</p><p><span class="quote"><span class="quote">Configurable</span></span> (or <span class="quote"><span class="quote">Not configurable</span></span>) means
that the symbol is initially chosen (or not) based on that the symbol is initially chosen (or not) based on
......
...@@ -383,7 +383,7 @@ compatible. ...@@ -383,7 +383,7 @@ compatible.
<para/> <para/>
</listitem> </listitem>
<listitem> <listitem xml:id="abi.versioning.__GLIBCXX__">
<para>Incremental bumping of a library pre-defined macro. For releases <para>Incremental bumping of a library pre-defined macro. For releases
before 3.4.0, the macro is <symbol>__GLIBCPP__</symbol>. For later before 3.4.0, the macro is <symbol>__GLIBCPP__</symbol>. For later
releases, it's <symbol>__GLIBCXX__</symbol>. (The libstdc++ project releases, it's <symbol>__GLIBCXX__</symbol>. (The libstdc++ project
......
...@@ -829,20 +829,37 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe ...@@ -829,20 +829,37 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
general public. general public.
</para> </para>
<para>Below is the macro which users may check for library version <para>Below are the macros which users may check for library version
information. </para> information. </para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term><code>_GLIBCXX_RELEASE</code></term>
<listitem>
<para>The major release number for libstdc++. This macro is defined
to the GCC major version that the libstdc++ headers belong to,
as an integer constant.
When compiling with GCC it has the same value as GCC's pre-defined
macro <symbol>__GNUC__</symbol>.
This macro can be used when libstdc++ is used with a non-GNU
compiler where <symbol>__GNUC__</symbol> is not defined, or has a
different value that doesn't correspond to the libstdc++ version.
This macro first appeared in the GCC 7.1 release and is not defined
for GCC 6.x or older releases.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><code>__GLIBCXX__</code></term> <term><code>__GLIBCXX__</code></term>
<listitem> <listitem>
<para>The current version of <para>The revision date of the libstdc++ source code,
libstdc++ in compressed ISO date format, as an unsigned in compressed ISO date format, as an unsigned
long. For details on the value of this particular macro for a long. For notes about using this macro and details on the value of
particular release, please consult the <link linkend="appendix.porting.abi"> this macro for a particular release, please consult the
ABI Policy and Guidelines</link> appendix. <link linkend="abi.versioning.__GLIBCXX__">ABI History</link>
</para> appendix.
</listitem> </para>
</listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
...@@ -1669,10 +1686,11 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) ...@@ -1669,10 +1686,11 @@ gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)
and efficiency. You, the programmer, are always required to take care and efficiency. You, the programmer, are always required to take care
with multiple threads. with multiple threads.
</para> </para>
<para>(As an example, the POSIX standard requires that C stdio FILE* <para>(As an example, the POSIX standard requires that C stdio
operations are atomic. POSIX-conforming C libraries (e.g, on Solaris <code>FILE*</code> operations are atomic. POSIX-conforming C libraries
and GNU/Linux) have an internal mutex to serialize operations on (e.g, on Solaris and GNU/Linux) have an internal mutex to serialize
FILE*s. However, you still need to not do stupid things like calling operations on <code>FILE*</code>s.
However, you still need to not do stupid things like calling
<code>fclose(fs)</code> in one thread followed by an access of <code>fclose(fs)</code> in one thread followed by an access of
<code>fs</code> in another.) <code>fs</code> in another.)
</para> </para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment