bug-gnulib
[Top][All Lists]
Advanced

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

Re: Build errors on Solaris 2.6 & 7


From: Paul Eggert
Subject: Re: Build errors on Solaris 2.6 & 7
Date: Sun, 13 Jan 2013 10:38:10 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 01/13/2013 09:11 AM, Tom G. Christensen wrote:
> I think the proper fix would be to wrap the definition in !HAVE_NET_IF_H || 
> HAVE_IF_NAMEINDEX same as the code that uses it.

Thanks, I pushed this:
---
 ChangeLog           | 8 ++++++++
 tests/test-net_if.c | 7 ++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79f857e..7cb6f97 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-01-13  Paul Eggert  <address@hidden>
+
+       net_if-tests: port to Solaris 7 + GCC 3.4.6
+       Problem reported by Tom G. Christensen in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00091.html>.
+       * tests/test-net_if.c (ni): Move to next the code that uses it,
+       so that it's declared only if needed.
+
 2013-01-12  Paul Eggert  <address@hidden>
 
        net_if-tests: port to older Solaris
diff --git a/tests/test-net_if.c b/tests/test-net_if.c
index 13ca82e..932f3e3 100644
--- a/tests/test-net_if.c
+++ b/tests/test-net_if.c
@@ -20,8 +20,6 @@
 
 #include <net/if.h>
 
-static struct if_nameindex ni;
-
 /* We do not yet have replacements for if_* functions on systems that
    lack a native <net/if.h>.  */
 #if HAVE_NET_IF_H && HAVE_IF_NAMEINDEX
@@ -90,7 +88,10 @@ main (int argc, char *argv[])
 #endif /* HAVE_NET_IF_H */
 
 #if !HAVE_NET_IF_H || HAVE_IF_NAMEINDEX
-  return !IF_NAMESIZE + ni.if_index + !!ni.if_name;
+  {
+    static struct if_nameindex ni;
+    return !IF_NAMESIZE + ni.if_index + !!ni.if_name;
+  }
 #else
   return 0;
 #endif
-- 
1.7.11.7





reply via email to

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