From: Bruno Haible Date: Thu, 5 Dec 2019 02:18:42 +0000 (+0100) Subject: Fix compilation errors in C++ mode with xlclang++ on AIX. X-Git-Tag: v1.0~4554 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=75da6fe3ad868618d88d1e1ec1f3135db6fce6c6;p=gnulib.git Fix compilation errors in C++ mode with xlclang++ on AIX. * lib/math.in.h (expm1l, fmal, remainderl, roundl): Don't redeclare in C++ mode on AIX. (isfinite, signbit): In C++ mode on AIX with clang, use the approach without C preprocessor macro. * lib/pthread.in.h (pthread_exit): Use _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS. * lib/threads.in.h (thrd_exit): Likewise. --- diff --git a/ChangeLog b/ChangeLog index c5d8df6c13..cb3ffc7e83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2019-12-04 Bruno Haible + + Fix compilation errors in C++ mode with xlclang++ on AIX. + * lib/math.in.h (expm1l, fmal, remainderl, roundl): Don't redeclare in + C++ mode on AIX. + (isfinite, signbit): In C++ mode on AIX with clang, use the approach + without C preprocessor macro. + * lib/pthread.in.h (pthread_exit): Use _GL_CXXALIAS_SYS_CAST instead of + _GL_CXXALIAS_SYS. + * lib/threads.in.h (thrd_exit): Likewise. + 2019-12-04 Bruno Haible Fix compilation error in C++ mode on Solaris 11 OpenIndiana. diff --git a/lib/math.in.h b/lib/math.in.h index 3aa7f4e970..3bb9663027 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -780,7 +780,9 @@ _GL_CXXALIAS_RPL (expm1l, long double, (long double x)); # else # if !@HAVE_DECL_EXPM1L@ # undef expm1l +# if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (expm1l, long double, (long double x)); +# endif # endif _GL_CXXALIAS_SYS (expm1l, long double, (long double x)); # endif @@ -960,8 +962,10 @@ _GL_CXXALIAS_RPL (fmal, long double, # else # if !@HAVE_FMAL@ # undef fmal +# if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (fmal, long double, (long double x, long double y, long double z)); +# endif # endif _GL_CXXALIAS_SYS (fmal, long double, (long double x, long double y, long double z)); @@ -1838,7 +1842,9 @@ _GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y)); # else # if !@HAVE_DECL_REMAINDERL@ # undef remainderl +# if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y)); +# endif # endif _GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y)); # endif @@ -1965,7 +1971,9 @@ _GL_CXXALIAS_RPL (roundl, long double, (long double x)); # else # if !@HAVE_DECL_ROUNDL@ # undef roundl +# if !(defined __cplusplus && defined _AIX) _GL_FUNCDECL_SYS (roundl, long double, (long double x)); +# endif # endif _GL_CXXALIAS_SYS (roundl, long double, (long double x)); # endif @@ -2249,7 +2257,7 @@ _GL_EXTERN_C int gl_isfinitel (long double x); # if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite -# if __GNUC__ >= 6 || defined __clang__ +# if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX) /* This platform's possibly defines isfinite through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool) @@ -2491,7 +2499,7 @@ _GL_EXTERN_C int gl_signbitl (long double arg); # if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit -# if __GNUC__ >= 6 || defined __clang__ +# if __GNUC__ >= 6 || (defined __clang__ && !defined _AIX) /* This platform's possibly defines signbit through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool) diff --git a/lib/pthread.in.h b/lib/pthread.in.h index e564140898..c94638b7e4 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -689,7 +689,7 @@ _GL_CXXALIAS_RPL (pthread_exit, _Noreturn void, (void *value)); # if !@HAVE_PTHREAD_EXIT@ _GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value)); # endif -_GL_CXXALIAS_SYS (pthread_exit, _Noreturn void, (void *value)); +_GL_CXXALIAS_SYS_CAST (pthread_exit, _Noreturn 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 0ed87b3374..39ccead948 100644 --- a/lib/threads.in.h +++ b/lib/threads.in.h @@ -268,7 +268,7 @@ _GL_WARN_ON_USE (thrd_join, "thrd_join is unportable - " # if !@HAVE_THREADS_H@ _GL_FUNCDECL_SYS (thrd_exit, _Noreturn void, (int)); # endif -_GL_CXXALIAS_SYS (thrd_exit, _Noreturn void, (int)); +_GL_CXXALIAS_SYS_CAST (thrd_exit, _Noreturn void, (int)); _GL_CXXALIASWARN (thrd_exit); #elif defined GNULIB_POSIXCHECK # undef thrd_exit