public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Add missing headers for errno and std::terminate
@ 2021-04-26 11:36 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-04-26 11:36 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

libstdc++-v3/ChangeLog:

	* include/bits/semaphore_base.h: Include <exception> and <errno.h>.

Tested x86_64-linux. Committed to trunk.

This should be backported to gcc-11 but it can wait until after the
11.1 release.

It affects non-linux targets which have POSIX semaphores. For linux
targets the <cerrno> header gets included in <bits/atomic_wait.h> but
for non-linux it doesn't. The testsuite is not picking this up,
probably because the testsuite is cursed by PCH by default.





[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 913 bytes --]

commit a38b1a59f8eb6f41a885f8a7c8838378be717b02
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 26 12:28:37 2021

    libstdc++: Add missing headers for errno and std::terminate
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/semaphore_base.h: Include <exception> and <errno.h>.

diff --git a/libstdc++-v3/include/bits/semaphore_base.h b/libstdc++-v3/include/bits/semaphore_base.h
index 4948f0fd0bc..9a55978068f 100644
--- a/libstdc++-v3/include/bits/semaphore_base.h
+++ b/libstdc++-v3/include/bits/semaphore_base.h
@@ -39,8 +39,10 @@
 #endif // __cpp_lib_atomic_wait
 
 #ifdef _GLIBCXX_HAVE_POSIX_SEMAPHORE
-# include <limits.h>
-# include <semaphore.h>
+# include <exception>	// std::terminate
+# include <cerrno>	// errno, EINTR, EAGAIN etc.
+# include <limits.h>	// SEM_VALUE_MAX
+# include <semaphore.h>	// sem_t, sem_init, sem_wait, sem_post etc.
 #endif
 
 #include <chrono>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-26 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 11:36 [committed] libstdc++: Add missing headers for errno and std::terminate Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).