mirror of
https://github.com/nmap/nmap.git
synced 2026-08-28 12:31:12 +00:00
Allow use of Windows' own inet_pton and inet_ntop functions
This commit is contained in:
parent
50054e6ed7
commit
855ec33fc0
5 changed files with 21 additions and 7 deletions
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "nbase.h"
|
||||
|
||||
#ifndef HAVE_INET_NTOP
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
|
@ -249,3 +251,5 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||
return (dst);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef HAVE_INET_NTOP */
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "nbase.h"
|
||||
|
||||
#ifndef HAVE_INET_PTON
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
|
@ -243,3 +245,5 @@ inet_pton6(const char *src, unsigned char *dst)
|
|||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef HAVE_INET_PTON */
|
||||
|
|
|
|||
|
|
@ -152,6 +152,12 @@
|
|||
#define HAVE_SYS_STAT_H 1
|
||||
/* #define HAVE_INTTYPES_H */
|
||||
|
||||
/* These functions are available on Vista and later */
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN6
|
||||
#define HAVE_INET_PTON 1
|
||||
#define HAVE_INET_NTOP 1
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* <wspiapi.h> only comes with Visual Studio. */
|
||||
#define HAVE_WSPIAPI_H 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue