aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/doc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-01-15 14:09:21 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2024-09-15 16:15:28 +0100
commit1dde83f0ec313166fc91e6784a0ca2e3db46acee (patch)
tree3d6913fad6e908c5448177965f6ce927f13f961c /libstdc++-v3/doc
parentf91fe35aa14bf4d44f2c8394301858b42e12ee45 (diff)
downloadgcc-1dde83f0ec313166fc91e6784a0ca2e3db46acee.zip
gcc-1dde83f0ec313166fc91e6784a0ca2e3db46acee.tar.gz
gcc-1dde83f0ec313166fc91e6784a0ca2e3db46acee.tar.bz2
libstdc++: Enable most of <chrono> for freestanding
This makes durations, time points and calendrical types available for freestanding. The clocks and time zone utilities are disabled for freestanding, as they require functions in the hosted lib. Add support for a new macro _GLIBCXX_NO_FREESTANDING_CHRONO which can be used to explicitly disable <chrono> for freestanding. libstdc++-v3/ChangeLog: * doc/xml/manual/using.xml (_GLIBCXX_NO_FREESTANDING_CHRONO): Document macro. * doc/html/*: Regenerate. * include/bits/chrono.h [_GLIBCXX_NO_FREESTANDING_CHRONO]: Only include <bits/require_hosted.h> when this macro is defined. [_GLIBCXX_HOSTED]: Only define clocks for hosted. * include/bits/version.def (chrono_udls): Remove hosted=yes. * include/bits/version.h: Regenerate. * include/std/chrono [_GLIBCXX_HOSTED]: Only define clocks and time zone utilities for hosted. * testsuite/std/time/freestanding.cc: New test.
Diffstat (limited to 'libstdc++-v3/doc')
-rw-r--r--libstdc++-v3/doc/html/manual/using_macros.html7
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml12
2 files changed, 19 insertions, 0 deletions
diff --git a/libstdc++-v3/doc/html/manual/using_macros.html b/libstdc++-v3/doc/html/manual/using_macros.html
index ae56469..67623b5 100644
--- a/libstdc++-v3/doc/html/manual/using_macros.html
+++ b/libstdc++-v3/doc/html/manual/using_macros.html
@@ -124,4 +124,11 @@
must be present on all vector operations or none, so this macro must
be defined to the same value for all translation units that create,
destroy, or modify vectors.
+ </p></dd><dt><span class="term"><code class="code">_GLIBCXX_NO_FREESTANDING_CHRONO</code></span></dt><dd><p>
+ Undefined by default. When defined, the
+ <code class="filename">&lt;chrono&gt;</code> header cannot
+ be used with <code class="option">-ffreestanding</code>.
+ When not defined, durations, time points, and calendar types are
+ available for freestanding, but the standard clocks and the time zone
+ database are not (because they require OS support).
</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_headers.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_dual_abi.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Headers </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Dual ABI</td></tr></table></div></body></html> \ No newline at end of file
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 6675359..4e1c700 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -1321,6 +1321,18 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
destroy, or modify vectors.
</para>
</listitem></varlistentry>
+
+ <varlistentry><term><code>_GLIBCXX_NO_FREESTANDING_CHRONO</code></term>
+ <listitem>
+ <para>
+ Undefined by default. When defined, the
+ <filename class="headerfile">&lt;chrono&gt;</filename> header cannot
+ be used with <option>-ffreestanding</option>.
+ When not defined, durations, time points, and calendar types are
+ available for freestanding, but the standard clocks and the time zone
+ database are not (because they require OS support).
+ </para>
+ </listitem></varlistentry>
</variablelist>
</section>