bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setsockopt on mingw


From: Simon Josefsson
Subject: Re: setsockopt on mingw
Date: Mon, 28 Apr 2008 20:10:36 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Hi Simon,
>
> * Simon Josefsson wrote on Mon, Apr 28, 2008 at 04:39:08PM CEST:
>> --- a/m4/sys_socket_h.m4
>> +++ b/m4/sys_socket_h.m4
>> @@ -45,6 +45,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
>>        HAVE_WINSOCK2_H=0
>>        HAVE_WS2TCPIP_H=0
>>      else
>> +      AC_REQUIRE([AC_C_INLINE])
>>        HAVE_SYS_SOCKET_H=0
>>        dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
>>        dnl the check for those headers unconditional; yet cygwin reports
>
> Please note that AC_REQUIRE does not operate the way this change makes
> people believe.  It causes the text of AC_C_INLINE to be expanded
> *before* the beginning of the expansion of gl_HEADER_SYS_SOCKET.
>
> Even if that is clear to you now, it will confuse others reading your
> code.  That confusion is lessened if you stick to listing AC_REQUIRE
> stanzas at the very beginning of macro definitions, outside of any
> shell conditional statements.

Thanks.  I'm not sure I was aware of this.  I pushed the patch below.
It causes a slightly unnecessary call to AC_C_INLINE even in cases where
it isn't needed, but it doesn't seem harmful and I'm not sure of a good
way to avoid it.

/Simon

>From ca8e12bc871dc3ee65cec526ec2628abdd01ee8c Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 28 Apr 2008 20:08:35 +0200
Subject: [PATCH] Move AC_REQUIRE([AC_C_INLINE]) to top.
 Suggested by Ralf Wildenhues <address@hidden>.

---
 ChangeLog          |    5 +++++
 m4/sys_socket_h.m4 |    3 ++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 53fe2a8..36e8ab5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-28  Simon Josefsson  <address@hidden>
 
+       * m4/sys_socket_h.m4: Move AC_REQUIRE([AC_C_INLINE]) to top.
+       Suggested by Ralf Wildenhues <address@hidden>.
+
+2008-04-28  Simon Josefsson  <address@hidden>
+
        * lib/inet_ntop.h, lib/inet_pton.h: Remove files.
 
        * lib/inet_ntop.c: Include arpa/inet.h instead of inet_ntop.h.
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 5526c06..2e4e2f6 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -8,6 +8,8 @@ dnl From Simon Josefsson.
 
 AC_DEFUN([gl_HEADER_SYS_SOCKET],
 [
+  AC_REQUIRE([AC_C_INLINE])
+
   AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
     [gl_cv_header_sys_socket_h_selfcontained],
     [
@@ -45,7 +47,6 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
       HAVE_WINSOCK2_H=0
       HAVE_WS2TCPIP_H=0
     else
-      AC_REQUIRE([AC_C_INLINE])
       HAVE_SYS_SOCKET_H=0
       dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
       dnl the check for those headers unconditional; yet cygwin reports
-- 
1.5.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]