From ae9fb3d6654885ee1010a4a0a3dbb079a037c71e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 4 Jan 2021 08:02:18 +0100 Subject: [PATCH] ffsl, ffsll: Work around AIX 7.2 problem. * lib/string.in.h: On AIX, include for the declarations of ffsl and ffsll. * doc/glibc-functions/ffsl.texi: Document the AIX 7.2 problem. * doc/glibc-functions/ffsll.texi: Likewise. --- ChangeLog | 8 ++++++++ doc/glibc-functions/ffsl.texi | 4 ++++ doc/glibc-functions/ffsll.texi | 4 ++++ lib/string.in.h | 8 ++++++++ 4 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6f42f1ccc5..33cc845a9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-01-04 Bruno Haible + + ffsl, ffsll: Work around AIX 7.2 problem. + * lib/string.in.h: On AIX, include for the declarations of + ffsl and ffsll. + * doc/glibc-functions/ffsl.texi: Document the AIX 7.2 problem. + * doc/glibc-functions/ffsll.texi: Likewise. + 2021-01-04 Bruno Haible ssfmalloc: Fix includes. diff --git a/doc/glibc-functions/ffsl.texi b/doc/glibc-functions/ffsl.texi index 9f8357b2f7..441383cc38 100644 --- a/doc/glibc-functions/ffsl.texi +++ b/doc/glibc-functions/ffsl.texi @@ -11,6 +11,10 @@ Portability problems fixed by Gnulib: @item This function is missing on some platforms: FreeBSD 5.2.1, NetBSD 9.0, OpenBSD 6.7, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 10, Cygwin 1.7.x, mingw, MSVC 14, Android 9.0. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +AIX 7.2. @end itemize Portability problems not fixed by Gnulib: diff --git a/doc/glibc-functions/ffsll.texi b/doc/glibc-functions/ffsll.texi index a8493a969c..718ccfcafe 100644 --- a/doc/glibc-functions/ffsll.texi +++ b/doc/glibc-functions/ffsll.texi @@ -11,6 +11,10 @@ Portability problems fixed by Gnulib: @item This function is missing on many non-glibc platforms: Mac OS X 10.5, FreeBSD 6.0, NetBSD 9.0, OpenBSD 6.7, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 10, Cygwin 1.7.x, mingw, MSVC 14, Android 9.0. +@item +This function is declared in @code{} instead of @code{} +on some platforms: +AIX 7.2. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/string.in.h b/lib/string.in.h index c32fd36178..2f2e07bd77 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -69,6 +69,14 @@ # include #endif +/* AIX 7.2 declares ffsl and ffsll in , not in . */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \ + && defined _AIX) \ + && ! defined __GLIBC__ +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ -- 2.39.5