vasnwprintf tests: Add test of huge %ls arguments.
[gnulib.git] / m4 / net_if_h.m4
blobd16e694ef4c3005f3f38e70dc2aa03de581d7dbe
1 # net_if_h.m4
2 # serial 2
3 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_HEADER_NET_IF],
10   AC_CACHE_CHECK([whether <net/if.h> is self-contained],
11     [gl_cv_header_net_if_h_selfcontained],
12     [
13       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <net/if.h>]],
14                                          [[struct if_nameindex ni;]])],
15         [gl_cv_header_net_if_h_selfcontained=yes],
16         [gl_cv_header_net_if_h_selfcontained=no])
17     ])
18   if test $gl_cv_header_net_if_h_selfcontained = yes; then
19     GL_GENERATE_NET_IF_H=false
20   else
21     GL_GENERATE_NET_IF_H=true
22     AC_CHECK_HEADERS([net/if.h], [], [], [[#include <sys/socket.h>]])
23     gl_NEXT_HEADERS([net/if.h])
24     if test $ac_cv_header_net_if_h = yes; then
25       HAVE_NET_IF_H=1
26     else
27       HAVE_NET_IF_H=0
28     fi
29     AC_SUBST([HAVE_NET_IF_H])
30   fi