summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2015-06-13 08:07:08 -0700
committerGiampaolo Rodola <g.rodola@gmail.com>2015-06-13 08:07:08 -0700
commite703a4aa3f82f1c963166cbeb371b537256c27ec (patch)
treec889f63740d6a57a3f33a860ee453b7b0af20da9
parentb5d675ab1f2ab3d849564173539891ab56cd1703 (diff)
downloadpsutil-e703a4aa3f82f1c963166cbeb371b537256c27ec.tar.gz
(windows) remove inet_ntop
-rw-r--r--psutil/_psutil_windows.c1
-rw-r--r--psutil/arch/windows/inet_ntop.c24
-rw-r--r--psutil/arch/windows/inet_ntop.h10
-rw-r--r--setup.py1
4 files changed, 0 insertions, 36 deletions
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index f789e03d..670be24c 100644
--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -31,7 +31,6 @@
#include "arch/windows/process_info.h"
#include "arch/windows/process_handles.h"
#include "arch/windows/ntextapi.h"
-#include "arch/windows/inet_ntop.h"
#ifdef __MINGW32__
#include "arch/windows/glpi.h"
diff --git a/psutil/arch/windows/inet_ntop.c b/psutil/arch/windows/inet_ntop.c
deleted file mode 100644
index 39b05dfb..00000000
--- a/psutil/arch/windows/inet_ntop.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "inet_ntop.h"
-
-// From: https://memset.wordpress.com/2010/10/09/inet_ntop-for-win32/
-PCSTR
-WSAAPI
-inet_ntop(
- __in INT Family,
- __in PVOID pAddr,
- __out_ecount(StringBufSize) PSTR pStringBuf,
- __in size_t StringBufSize
- )
-{
- struct sockaddr_in srcaddr;
-
- memset(&srcaddr, 0, sizeof(struct sockaddr_in));
- memcpy(&(srcaddr.sin_addr), pAddr, sizeof(srcaddr.sin_addr));
-
- srcaddr.sin_family = Family;
- if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, pStringBuf, (LPDWORD) &StringBufSize) != 0) {
- DWORD rv = WSAGetLastError();
- return NULL;
- }
- return pStringBuf;
-} \ No newline at end of file
diff --git a/psutil/arch/windows/inet_ntop.h b/psutil/arch/windows/inet_ntop.h
deleted file mode 100644
index e9b83585..00000000
--- a/psutil/arch/windows/inet_ntop.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <ws2tcpip.h>
-
-PCSTR
-WSAAPI
-inet_ntop(
- __in INT Family,
- __in PVOID pAddr,
- __out_ecount(StringBufSize) PSTR pStringBuf,
- __in size_t StringBufSize
- ); \ No newline at end of file
diff --git a/setup.py b/setup.py
index 4c42548e..54a70c49 100644
--- a/setup.py
+++ b/setup.py
@@ -70,7 +70,6 @@ if sys.platform.startswith("win32"):
'psutil/arch/windows/process_info.c',
'psutil/arch/windows/process_handles.c',
'psutil/arch/windows/security.c',
- 'psutil/arch/windows/inet_ntop.c',
],
define_macros=[
VERSION_MACRO,