X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-net_if.c;h=f50864232d12da2d027072021f72b73044af11eb;hb=200969d8ebed76c9b82837406a87cc767fafac1b;hp=79a0df2b121bb81cdd03504d720d67bb94eda2d4;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/tests/test-net_if.c b/tests/test-net_if.c index 79a0df2b1..f50864232 100644 --- a/tests/test-net_if.c +++ b/tests/test-net_if.c @@ -1,5 +1,5 @@ /* Test of functions. - Copyright (C) 2010-2011 Free Software Foundation, Inc. + Copyright (C) 2010-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,11 +20,17 @@ #include -#include "signature.h" +static struct if_nameindex ni; + +/* We do not yet have replacements for if_* functions on systems that + lack a native . */ +#if HAVE_NET_IF_H +# include "signature.h" SIGNATURE_CHECK (if_freenameindex, void, (struct if_nameindex *)); SIGNATURE_CHECK (if_indextoname, char *, (unsigned int, char *)); SIGNATURE_CHECK (if_nameindex, struct if_nameindex *, (void)); SIGNATURE_CHECK (if_nametoindex, unsigned int, (const char *)); +#endif #include /* NULL */ #include /* fprintf */ @@ -32,6 +38,7 @@ SIGNATURE_CHECK (if_nametoindex, unsigned int, (const char *)); int main (int argc, char *argv[]) { +#if HAVE_NET_IF_H struct if_nameindex *ifnp, *p; p = ifnp = if_nameindex (); @@ -80,6 +87,7 @@ main (int argc, char *argv[]) } if_freenameindex (ifnp); +#endif /* HAVE_NET_IF_H */ - return 0; + return !IF_NAMESIZE + ni.if_index + !!ni.if_name; }