From 45819c74f6994d901b733883e81d968c10647420 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 Dec 2019 13:10:23 +0100 Subject: [PATCH] Fix compilation errors in C++ mode on FreeBSD. * lib/pthread.in.h (pthread_exit): Remove _Noreturn from prototype. * tests/test-pthread-c++.cc (GNULIB_NAMESPACE::pthread_exit): Likewise. * lib/threads.in.h (thrd_exit): Likewise. * tests/test-threads-c++.cc (GNULIB_NAMESPACE::thrd_exit): Likewise. --- ChangeLog | 8 ++++++++ lib/pthread.in.h | 5 ++--- lib/threads.in.h | 5 ++--- tests/test-pthread-c++.cc | 2 +- tests/test-threads-c++.cc | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index b255e73dd8..d452db231a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2019-12-08 Bruno Haible + + Fix compilation errors in C++ mode on FreeBSD. + * lib/pthread.in.h (pthread_exit): Remove _Noreturn from prototype. + * tests/test-pthread-c++.cc (GNULIB_NAMESPACE::pthread_exit): Likewise. + * lib/threads.in.h (thrd_exit): Likewise. + * tests/test-threads-c++.cc (GNULIB_NAMESPACE::thrd_exit): Likewise. + 2019-12-08 Bruno Haible Fix compilation errors in C++ mode on macOS and FreeBSD. diff --git a/lib/pthread.in.h b/lib/pthread.in.h index 4ba7e7b0d9..a70d0234e5 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -689,9 +689,8 @@ _GL_CXXALIAS_RPL (pthread_exit, _Noreturn void, (void *value)); # if !@HAVE_PTHREAD_EXIT@ _GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value)); # endif -/* Need to cast, because on AIX with xlclang++, the return type is - void. */ -_GL_CXXALIAS_SYS_CAST (pthread_exit, _Noreturn void, (void *value)); +/* Need to cast because of AIX with xlclang++. */ +_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value)); # endif _GL_CXXALIASWARN (pthread_exit); #elif defined GNULIB_POSIXCHECK diff --git a/lib/threads.in.h b/lib/threads.in.h index 31362579c2..5fcbb09039 100644 --- a/lib/threads.in.h +++ b/lib/threads.in.h @@ -268,9 +268,8 @@ _GL_WARN_ON_USE (thrd_join, "thrd_join is unportable - " # if !@HAVE_THREADS_H@ _GL_FUNCDECL_SYS (thrd_exit, _Noreturn void, (int)); # endif -/* Need to cast, because on AIX with xlclang++, the return type is - void. */ -_GL_CXXALIAS_SYS_CAST (thrd_exit, _Noreturn void, (int)); +/* Need to cast because of AIX with xlclang++. */ +_GL_CXXALIAS_SYS_CAST (thrd_exit, void, (int)); _GL_CXXALIASWARN (thrd_exit); #elif defined GNULIB_POSIXCHECK # undef thrd_exit diff --git a/tests/test-pthread-c++.cc b/tests/test-pthread-c++.cc index aa221bcbb9..43f1b979bc 100644 --- a/tests/test-pthread-c++.cc +++ b/tests/test-pthread-c++.cc @@ -68,7 +68,7 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_join, int, (pthread_t, void **)); #endif #if GNULIB_TEST_PTHREAD_THREAD -SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_exit, _Noreturn void, (void *)); +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_exit, void, (void *)); #endif /* =========== Once-only control (initialization) functions =========== */ diff --git a/tests/test-threads-c++.cc b/tests/test-threads-c++.cc index ae0d86507a..07da403923 100644 --- a/tests/test-threads-c++.cc +++ b/tests/test-threads-c++.cc @@ -34,7 +34,7 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_sleep, int, SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_yield, void, (void)); SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_detach, int, (thrd_t)); SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_join, int, (thrd_t, int *)); -SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_exit, _Noreturn void, (int)); +SIGNATURE_CHECK (GNULIB_NAMESPACE::thrd_exit, void, (int)); #endif #if GNULIB_TEST_MTX -- 2.39.5