Fix libevent requiring <net/if.h>.
This commit is contained in:
parent
154f5b5cce
commit
14841fb43c
|
@ -81,6 +81,33 @@ diff -Paur --no-dereference -- libevent.upstream/configure libevent/configure
|
||||||
;
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
diff -Paur --no-dereference -- libevent.upstream/evutil.c libevent/evutil.c
|
||||||
|
--- libevent.upstream/evutil.c
|
||||||
|
+++ libevent/evutil.c
|
||||||
|
@@ -76,8 +76,10 @@
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#ifndef _WIN32
|
||||||
|
+#if __has_include(<net/if.h>)
|
||||||
|
#include <net/if.h>
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
#ifdef EVENT__HAVE_IFADDRS_H
|
||||||
|
#include <ifaddrs.h>
|
||||||
|
#endif
|
||||||
|
@@ -2007,7 +2009,12 @@
|
||||||
|
if (cp == NULL)
|
||||||
|
return evutil_inet_pton(af, src, dst);
|
||||||
|
|
||||||
|
+#if __has_include(<net/if.h>)
|
||||||
|
if_index = if_nametoindex(cp + 1);
|
||||||
|
+#else
|
||||||
|
+ if_index = 0;
|
||||||
|
+ errno = ENODEV;
|
||||||
|
+#endif
|
||||||
|
if (if_index == 0) {
|
||||||
|
/* Could be numeric */
|
||||||
|
if_index = strtoul(cp + 1, &check, 10);
|
||||||
diff -Paur --no-dereference -- libevent.upstream/evutil_rand.c libevent/evutil_rand.c
|
diff -Paur --no-dereference -- libevent.upstream/evutil_rand.c libevent/evutil_rand.c
|
||||||
--- libevent.upstream/evutil_rand.c
|
--- libevent.upstream/evutil_rand.c
|
||||||
+++ libevent/evutil_rand.c
|
+++ libevent/evutil_rand.c
|
||||||
|
|
Loading…
Reference in New Issue