Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Android] Fix NetworkInterface.GetAllNetworkInterfaces (#76370)
* Revert "[Android] Port getifaddrs implementation from Xamarin.Android (#71943)"

This reverts commit 1de4a5c.

* Fix allocating memory block for interfaces and addresses on recent Android SDKs

* Detect loopback interface on Android

* Add comment with explanation

* Simplify the changes to be closer to the original code

* Fix build

* Fix typos

Co-authored-by: Alexander Köplinger <[email protected]>

* Improve comment

* Indent using spaces instead of tabs

* Remove check for ifaddrs.h

* Add ANDROID_GETIFADDRS_WORKAROUND

* Update comment

Co-authored-by: Alexander Köplinger <[email protected]>
  • Loading branch information
simonrozsival and akoeplinger committed Oct 3, 2022
commit 4d1081a377d81dc7e76d315f815bf4b228a61e7b
7 changes: 2 additions & 5 deletions src/native/libs/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/extra_libs.cmake)
set(NATIVE_LIBS_EXTRA)
append_extra_system_libs(NATIVE_LIBS_EXTRA)

if (CLR_CMAKE_TARGET_ANDROID)
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)

list (APPEND NATIVE_LIBS_EXTRA -llog)
list (APPEND NATIVE_SOURCES pal_ifaddrs.c)
if (CLR_CMAKE_TARGET_ANDROID AND NOT HAVE_GETIFADDRS)
add_definitions(-DANDROID_GETIFADDRS_WORKAROUND)
endif ()

if (GEN_SHARED_LIB)
Expand Down
Loading