]> git.eshelyaron.com Git - emacs.git/commitdiff
configure.ac: Fix FIONREAD check with gcc-14 on Solaris
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 23 Oct 2024 13:41:08 +0000 (15:41 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 25 Oct 2024 05:06:51 +0000 (07:06 +0200)
Before this fix, it would fail to build with gcc-14 with the error:
conftest.c: In function 'main':
conftest.c:265:11: error: implicit declaration of function 'ioctl'
 [-Wimplicit-function-declaration]
  265 | int foo = ioctl (0, FIONREAD, &foo);
      |           ^~~~~

Solaris documents ioctl() as being defined in <unistd.h>.

* configure.ac: Fix FIONREAD check with gcc-14 on Solaris.
Ref:
https://lists.gnu.org/r/emacs-devel/2024-10/msg00195.html

Copyright-paperwork-exempt: yes
(cherry picked from commit 5e5689a2a40cd16d7593a0c7ddea5511adc3bf22)

configure.ac

index 0540d18b1422b89736eb4b43831d21789d63543c..c49bc0e80d6e217b8eef90e830b0580ab0602299 100644 (file)
@@ -7150,6 +7150,9 @@ AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD],
                            #ifdef USG5_4
                            # include <sys/filio.h>
                            #endif
+                           #ifdef HAVE_UNISTD_H
+                           # include <unistd.h> /* defines ioctl() on Solaris */
+                           #endif
                          ]],
                          [[int foo = ioctl (0, FIONREAD, &foo);]])],
         [emacs_cv_usable_FIONREAD=yes],