]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix autoconf check for O_NONBLOCK in <fcntl.h>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Aug 2024 11:38:18 +0000 (12:38 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 28 Aug 2024 20:34:22 +0000 (21:34 +0100)
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.

libstdc++-v3/config.h.in
libstdc++-v3/configure
libstdc++-v3/configure.ac

index 486ba450749950597e374339cb8e6ae05812148b..91e920044ee4a02f8b394091905bb76096643866 100644 (file)
 /* Define if openat is available in <fcntl.h>. */
 #undef HAVE_OPENAT
 
+/* Define if O_NONBLOCK is defined in <fcntl.h> */
+#undef HAVE_O_NONBLOCK
+
 /* Define if poll is available in <poll.h>. */
 #undef HAVE_POLL
 
index 305675eaa1e1129d875fda867ee83670c1cda883..005c4a29fd099f3d05edeb9af5e05d69e9036e4d 100755 (executable)
@@ -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 :
 
+$as_echo "#define HAVE_O_NONBLOCK 1" >>confdefs.h
+
 fi
 
 fi
index 4049f54bd5a37d98e80a4231d53014937ee07d93..a3b257fe6528d19e3689acc3d78a8ea1af5038fa 100644 (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_SETFL,,,[#include <fcntl.h>])
 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
 
 # For Transactional Memory TS