Skip to content

Commit 00619e0

Browse files
authored
Modify conditional to have Android API version check (#526)
Co-authored-by: Cameron Miller <[email protected]>
1 parent 64da67c commit 00619e0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/network_interface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ NetworkInterface::Info NetworkInterface::info() const {
331331
}
332332

333333
#else // _WIN32
334-
#ifndef ANDROID
334+
#if !defined(ANDROID) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 24)
335335
struct ifaddrs* ifaddrs = 0;
336336
struct ifaddrs* if_it = 0;
337337
getifaddrs(&ifaddrs);

src/utils/routing_utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ set<string> network_interfaces() {
413413
}
414414
#else
415415
set<string> network_interfaces() {
416-
#ifndef ANDROID
416+
#if !defined(ANDROID) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 24)
417417
set<string> output;
418418
struct ifaddrs* ifaddrs = 0;
419419
struct ifaddrs* if_it = 0;

0 commit comments

Comments
 (0)