summaryrefslogtreecommitdiff
path: root/drivers/unix/ip_unix.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2016-09-03 19:36:44 -0300
committerGeorge Marques <george@gmarqu.es>2016-09-03 19:36:44 -0300
commitc9b82498b4b8de7b5f4c19873421d32ca1749ed2 (patch)
tree0eb93a7f5534ae6ca54b7d31a274653bce806f71 /drivers/unix/ip_unix.cpp
parent2eaad1cfd1c96538d7aaf8bbd46535f8a143d2ad (diff)
Fix drivers coding for WinRT
- Add a proper function to retrieve IP addresses. - Solve issues with Windows FileAccess and DirAccess to use the same code for WinRT. - Add patches to the GLES2 rasterizer to workaround ANGLE issues.
Diffstat (limited to 'drivers/unix/ip_unix.cpp')
-rw-r--r--drivers/unix/ip_unix.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp
index 535a425302..08a8c19583 100644
--- a/drivers/unix/ip_unix.cpp
+++ b/drivers/unix/ip_unix.cpp
@@ -28,7 +28,7 @@
/*************************************************************************/
#include "ip_unix.h"
-#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) && !defined(WINRT_ENABLED)
+#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED)
#ifdef WINDOWS_ENABLED
@@ -83,6 +83,19 @@ IP_Address IP_Unix::_resolve_hostname(const String& p_hostname) {
void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const {
+ using namespace Windows::Networking;
+ using namespace Windows::Networking::Connectivity;
+
+ auto hostnames = NetworkInformation::GetHostNames();
+
+ for (int i = 0; i < hostnames->Size; i++) {
+
+ if (hostnames->GetAt(i)->Type == HostNameType::Ipv4 && hostnames->GetAt(i)->IPInformation != nullptr) {
+
+ r_addresses->push_back(IP_Address(String(hostnames->GetAt(i)->CanonicalName->Data())));
+
+ }
+ }
};
#else