diff options
author | Bruno Haible <bruno@clisp.org> | 2019-12-08 13:10:23 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2019-12-08 13:10:23 +0100 |
commit | 45819c74f6994d901b733883e81d968c10647420 (patch) | |
tree | da0bad39ec8e40b6a9ab817222d4cdfea68fbd5e | |
parent | 03cd507fb88a3a265978cfe0a367cf69e305c54e (diff) | |
download | gnulib-45819c74f6994d901b733883e81d968c10647420.tar.gz gnulib-45819c74f6994d901b733883e81d968c10647420.tar.bz2 |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib/pthread.in.h | 5 | ||||
-rw-r--r-- | lib/threads.in.h | 5 | ||||
-rw-r--r-- | tests/test-pthread-c++.cc | 2 | ||||
-rw-r--r-- | tests/test-threads-c++.cc | 2 |
5 files changed, 14 insertions, 8 deletions
@@ -1,5 +1,13 @@ 2019-12-08 Bruno Haible <bruno@clisp.org> + 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 <bruno@clisp.org> + Fix compilation errors in C++ mode on macOS and FreeBSD. * lib/math.in.h (isfinite, isinf, isnan, signbit): In C++ mode on macOS or FreeBSD with clang, use the approach without C preprocessor macro. 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 |