Skip to content

Commit b459866

Browse files
committed
Android: Fix the build
Include <sys/select.h> for the fd_set type. In the configure script, check whether 'unsigned long' is the underlying type of fd_set. Use u_long instead of ulong.
1 parent 7f5fb80 commit b459866

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

agent/mibgroup/ip-mib/data_access/ipaddress_linux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int _load_v6(netsnmp_container *container, int idx_offset);
5050
int
5151
netsnmp_access_ipaddress_extra_prefix_info(int index,
5252
u_long *preferedlt,
53-
ulong *validlt,
53+
u_long *validlt,
5454
char *addr);
5555
#endif
5656

@@ -523,7 +523,7 @@ netsnmp_access_other_info_get(int index, int family)
523523

524524
int
525525
netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt,
526-
ulong *validlt, char *addr)
526+
u_long *validlt, char *addr)
527527
{
528528

529529
struct {

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31577,7 +31577,7 @@ CFLAGS="$CFLAGS -Werror"
3157731577

3157831578
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5
3157931579
printf %s "checking for the type of fd_set::fds_bits... " >&6; }
31580-
for type in __fd_mask __int32_t long\ int unknown; do
31580+
for type in __fd_mask __int32_t long 'unsigned long' unknown; do
3158131581
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3158231582
/* end confdefs.h. */
3158331583

configure.d/config_project_types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS
6666
CFLAGS="$CFLAGS -Werror"
6767

6868
AC_MSG_CHECKING([for the type of fd_set::fds_bits])
69-
for type in __fd_mask __int32_t long\ int unknown; do
69+
for type in __fd_mask __int32_t long 'unsigned long' unknown; do
7070
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
7171
#include <sys/select.h>
7272
#include <stddef.h>

include/net-snmp/types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
#endif
2424

2525
#include <sys/types.h>
26+
#ifdef __ANDROID__
27+
#include <sys/select.h>
28+
#endif
2629

2730
#if defined(WIN32) && !defined(cygwin)
2831
typedef HANDLE netsnmp_pid_t;

0 commit comments

Comments
 (0)