]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Ignore _GLIBCXX_USE_POSIX_SEMAPHORE if not supported [PR116992]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 7 Oct 2024 09:22:24 +0000 (10:22 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 9 Oct 2024 12:41:06 +0000 (13:41 +0100)
commit9a5ac633f0f49c819f2745584475051c9eb8f6e0
tree92fc36f7ea4d5f249f252a486675bcb4a82868b7
parente998014d1b14592c43b0f655793011c6395ff02a
libstdc++: Ignore _GLIBCXX_USE_POSIX_SEMAPHORE if not supported [PR116992]

If _GLIBCXX_HAVE_POSIX_SEMAPHRE is undefined then users get an error
when defining _GLIBCXX_USE_POSIX_SEMAPHORE. We can just ignore it
instead (and warn them it's being ignored).

This fixes a testsuite failure on hppa64-hp-hpux11.11 (and probably some
other targets):

FAIL: 30_threads/semaphore/platform_try_acquire_for.cc  -std=gnu++20 (test for excess errors)
Excess errors:
semaphore:49: error: '__semaphore_impl' has not been declared

libstdc++-v3/ChangeLog:

PR libstdc++/116992
* include/bits/semaphore_base.h (_GLIBCXX_USE_POSIX_SEMAPHORE):
Undefine and issue a warning if POSIX sem_t is not supported.
* testsuite/30_threads/semaphore/platform_try_acquire_for.cc:
Prune new warning.
libstdc++-v3/include/bits/semaphore_base.h
libstdc++-v3/testsuite/30_threads/semaphore/platform_try_acquire_for.cc