ifaddrs-android-0001-complete-struct.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/thirdparty/misc/ifaddrs-android.h b/thirdparty/misc/ifaddrs-android.h
  2. index e7d81e813f..04ff2ca58b 100644
  3. --- a/thirdparty/misc/ifaddrs-android.h
  4. +++ b/thirdparty/misc/ifaddrs-android.h
  5. @@ -34,6 +34,9 @@
  6. // Fills out a list of ifaddr structs (see below) which contain information
  7. // about every network interface available on the host.
  8. // See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function).
  9. +#ifdef __cplusplus
  10. +extern "C" {
  11. +#endif
  12. struct ifaddrs {
  13. struct ifaddrs* ifa_next;
  14. char* ifa_name;
  15. @@ -42,7 +45,17 @@ struct ifaddrs {
  16. struct sockaddr* ifa_netmask;
  17. // Real ifaddrs has broadcast, point to point and data members.
  18. // We don't need them (yet?).
  19. + // We never initialize the following members. We only define them to match the ifaddrs struct.
  20. + union
  21. + {
  22. + struct sockaddr *ifu_broadaddr;
  23. + struct sockaddr *ifu_dstaddr;
  24. + } ifa_ifu;
  25. + void *ifa_data;
  26. };
  27. +#ifdef __cplusplus
  28. +}
  29. +#endif
  30. int getifaddrs(struct ifaddrs** result);
  31. void freeifaddrs(struct ifaddrs* addrs);