37 lines
1.1 KiB
Diff
37 lines
1.1 KiB
Diff
--- dcpp/Util.h 2015-04-20 02:57:16.000000000 +0500
|
|
+++ dcpp/Util.h.new 2017-10-09 15:00:00.000000000 +0500
|
|
@@ -28,6 +28,13 @@
|
|
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
+
|
|
+#ifdef _WIN32
|
|
+#include <winsock2.h>
|
|
+#else
|
|
+#include <sys/socket.h>
|
|
+#endif
|
|
+
|
|
#include <unistd.h>
|
|
#include <cstdlib>
|
|
#include <vector>
|
|
@@ -270,7 +270,7 @@
|
|
#ifdef _WIN32
|
|
return _atoi64(aString.c_str());
|
|
#else
|
|
- #ifndef __HAIKU__
|
|
+ #if !defined(__HAIKU__) && defined(__GLIBC__)
|
|
return strtoq(aString.c_str(), (char **)NULL, 10);
|
|
#else
|
|
return strtoll(aString.c_str(), (char **)NULL, 10);
|
|
@@ -403,8 +410,8 @@
|
|
}
|
|
|
|
static string encodeURI(const string& /*aString*/, bool reverse = false);
|
|
- static string getLocalIp();
|
|
- static std::vector<string> getLocalIPs();
|
|
+ static string getLocalIp(unsigned short sa_family = AF_UNSPEC);
|
|
+ static std::vector<string> getLocalIPs(unsigned short sa_family = AF_UNSPEC);
|
|
static bool isPrivateIp(string const& ip);
|
|
static string formatAdditionalInfo(const std::string& aIp, bool sIp, bool sCC);
|
|
/**
|