Skip to content

Commit 40e320b

Browse files
author
Xavier de Gaye
committed
Issue python#28538: On Darwin net/if.h requires that sys/socket.h be included beforehand.
1 parent 7087842 commit 40e320b

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

configure

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12645,13 +12645,25 @@ fi
1264512645
rm -f core conftest.err conftest.$ac_objext \
1264612646
conftest$ac_exeext conftest.$ac_ext
1264712647

12648-
# On Android API level 24 if_nameindex() is available, but the if_nameindex
12649-
# structure is not defined.
12648+
# On Android API level 24 with android-ndk-r13, if_nameindex() is available,
12649+
# but the if_nameindex structure is not defined.
1265012650
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for if_nameindex" >&5
1265112651
$as_echo_n "checking for if_nameindex... " >&6; }
1265212652
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1265312653
/* end confdefs.h. */
1265412654
12655+
#include <stdio.h>
12656+
#ifdef STDC_HEADERS
12657+
# include <stdlib.h>
12658+
# include <stddef.h>
12659+
#else
12660+
# ifdef HAVE_STDLIB_H
12661+
# include <stdlib.h>
12662+
# endif
12663+
#endif
12664+
#ifdef HAVE_SYS_SOCKET_H
12665+
# include <sys/socket.h>
12666+
#endif
1265512667
#ifdef HAVE_NET_IF_H
1265612668
# include <net/if.h>
1265712669
#endif

configure.ac

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,10 +3736,22 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
37363736
AC_MSG_RESULT(no)
37373737
])
37383738

3739-
# On Android API level 24 if_nameindex() is available, but the if_nameindex
3740-
# structure is not defined.
3739+
# On Android API level 24 with android-ndk-r13, if_nameindex() is available,
3740+
# but the if_nameindex structure is not defined.
37413741
AC_MSG_CHECKING(for if_nameindex)
37423742
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3743+
#include <stdio.h>
3744+
#ifdef STDC_HEADERS
3745+
# include <stdlib.h>
3746+
# include <stddef.h>
3747+
#else
3748+
# ifdef HAVE_STDLIB_H
3749+
# include <stdlib.h>
3750+
# endif
3751+
#endif
3752+
#ifdef HAVE_SYS_SOCKET_H
3753+
# include <sys/socket.h>
3754+
#endif
37433755
#ifdef HAVE_NET_IF_H
37443756
# include <net/if.h>
37453757
#endif

0 commit comments

Comments
 (0)