libstdc++: Fix autoconf check for O_NONBLOCK in <fcntl.h>

I misused the AC_CHECK_DECL macro, assuming that it behaved like
AC_CHECK_DECLS and always defined a HAVE_xxx macro if the decl was
found. Instead, the [action-if-found] shell commands are needed to
defined HAVE_O_NONBLOCK explicitly.

libstdc++-v3/ChangeLog:

	* configure.ac: Fix check for O_NONBLOCK.
	* config.h.in: Regenerate.
	* configure: Regenerate.
This commit is contained in:
Jonathan Wakely 2024-08-28 12:38:18 +01:00 committed by Jonathan Wakely
parent 51b0fef4e6
commit b68561dd79
No known key found for this signature in database
3 changed files with 9 additions and 1 deletions

View File

@ -302,6 +302,9 @@
/* Define if openat is available in <fcntl.h>. */ /* Define if openat is available in <fcntl.h>. */
#undef HAVE_OPENAT #undef HAVE_OPENAT
/* Define if O_NONBLOCK is defined in <fcntl.h> */
#undef HAVE_O_NONBLOCK
/* Define if poll is available in <poll.h>. */ /* Define if poll is available in <poll.h>. */
#undef HAVE_POLL #undef HAVE_POLL

View File

@ -54132,6 +54132,8 @@ if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then
" "
if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes; then : if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes; then :
$as_echo "#define HAVE_O_NONBLOCK 1" >>confdefs.h
fi fi
fi fi

View File

@ -554,7 +554,10 @@ AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h netdb.h arpa
AC_CHECK_DECL(F_GETFL,,,[#include <fcntl.h>]) AC_CHECK_DECL(F_GETFL,,,[#include <fcntl.h>])
AC_CHECK_DECL(F_SETFL,,,[#include <fcntl.h>]) AC_CHECK_DECL(F_SETFL,,,[#include <fcntl.h>])
if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then
AC_CHECK_DECL(O_NONBLOCK,,,[#include <fcntl.h>]) AC_CHECK_DECL(O_NONBLOCK,
AC_DEFINE(HAVE_O_NONBLOCK,1,[Define if O_NONBLOCK is defined in <fcntl.h>]),
[],
[#include <fcntl.h>])
fi fi
# For Transactional Memory TS # For Transactional Memory TS