Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bfa1ed

Browse files
author
Xavier de Gaye
committed
Issue #28538: Merge 3.6.
2 parents 8cbd3df + 7087842 commit 3bfa1ed

3 files changed

Lines changed: 50 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ Documentation
579579
Build
580580
-----
581581

582+
- Issue #28538: Fix the compilation error that occurs because if_nameindex() is
583+
available on Android API level 24, but the if_nameindex structure is not
584+
defined.
585+
582586
- Issue #20211: Do not add the directory for installing C header files and the
583587
directory for installing object code libraries to the cross compilation
584588
search paths. Original patch by Thomas Petazzoni.

configure

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11202,7 +11202,6 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
1120211202
futimens futimes gai_strerror getentropy \
1120311203
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
1120411204
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
11205-
if_nameindex \
1120611205
initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
1120711206
memrchr mbrtowc mkdirat mkfifo \
1120811207
mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
@@ -12646,6 +12645,39 @@ else
1264612645
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1264712646
$as_echo "no" >&6; }
1264812647

12648+
fi
12649+
rm -f core conftest.err conftest.$ac_objext \
12650+
conftest$ac_exeext conftest.$ac_ext
12651+
12652+
# On Android API level 24 if_nameindex() is available, but the if_nameindex
12653+
# structure is not defined.
12654+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for if_nameindex" >&5
12655+
$as_echo_n "checking for if_nameindex... " >&6; }
12656+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12657+
/* end confdefs.h. */
12658+
12659+
#ifdef HAVE_NET_IF_H
12660+
# include <net/if.h>
12661+
#endif
12662+
12663+
int
12664+
main ()
12665+
{
12666+
struct if_nameindex *ni = if_nameindex(); int x = ni[0].if_index;
12667+
;
12668+
return 0;
12669+
}
12670+
_ACEOF
12671+
if ac_fn_c_try_link "$LINENO"; then :
12672+
12673+
$as_echo "#define HAVE_IF_NAMEINDEX 1" >>confdefs.h
12674+
12675+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12676+
$as_echo "yes" >&6; }
12677+
else
12678+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12679+
$as_echo "no" >&6; }
12680+
1264912681
fi
1265012682
rm -f core conftest.err conftest.$ac_objext \
1265112683
conftest$ac_exeext conftest.$ac_ext

configure.ac

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3386,7 +3386,6 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
33863386
futimens futimes gai_strerror getentropy \
33873387
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
33883388
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
3389-
if_nameindex \
33903389
initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
33913390
memrchr mbrtowc mkdirat mkfifo \
33923391
mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
@@ -3739,6 +3738,19 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
37393738
AC_MSG_RESULT(no)
37403739
])
37413740

3741+
# On Android API level 24 if_nameindex() is available, but the if_nameindex
3742+
# structure is not defined.
3743+
AC_MSG_CHECKING(for if_nameindex)
3744+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3745+
#ifdef HAVE_NET_IF_H
3746+
# include <net/if.h>
3747+
#endif
3748+
]], [[struct if_nameindex *ni = if_nameindex(); int x = ni[0].if_index;]])],
3749+
[AC_DEFINE(HAVE_IF_NAMEINDEX, 1, Define to 1 if you have the 'if_nameindex' function.)
3750+
AC_MSG_RESULT(yes)],
3751+
[AC_MSG_RESULT(no)
3752+
])
3753+
37423754
# On OSF/1 V5.1, getaddrinfo is available, but a define
37433755
# for [no]getaddrinfo in netdb.h.
37443756
AC_MSG_CHECKING(for getaddrinfo)

0 commit comments

Comments
 (0)