]> 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 <jwakely@redhat.com>
Mon, 7 Oct 2024 08:55:19 +0000 (09:55 +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.

(cherry picked from commit b68561dd7925dfee1836f75d3fa8d33fff5c2498)

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

index 639000d797adcfcc4475286d8670496312f14d6c..4bf9b428228047a01951fd924863b04d6936e1ea 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 ccc23f1b3522cda9a7fecbe5638caf90040cdb65..3ea275e9ab2c2ee0ff38b50e39da52aa7a770d47 100755 (executable)
@@ -77901,6 +77901,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 dc0c61973d1c2b07399e2a2d8e7bf502ef6c6ea0..dad313a2376799b03e963dff2513cb00a54532ca 100644 (file)
@@ -503,7 +503,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