diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-02 18:08:49 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-02 18:08:49 +0000 |
commit | 1a9b84820cd4eb009ba4b73421619e573f702241 (patch) | |
tree | b99e952262f3eecbc8ba181589264e297b75df13 /win | |
parent | 2f1466ee943f870c157bb065edd92037c79e4b22 (diff) |
No forget using windows' broken inet_pton and inet_ntop, they are not POSIX compliant and just causes more compile errors. We use our own, period.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11460 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win')
-rw-r--r-- | win/inspircd_win32wrapper.cpp | 7 | ||||
-rw-r--r-- | win/inspircd_win32wrapper.h | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index cece56344..97f690d7d 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -46,8 +46,7 @@ int inet_aton(const char *cp, struct in_addr *addr) return (addr->s_addr == INADDR_NONE) ? 0 : 1; } -#if !defined(NTDDI_VERSION) || (NTDDI_VERSION < NTDDI_LONGHORN) -const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) +const char *insp_inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { if (af == AF_INET) @@ -70,15 +69,13 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt) } return NULL; } -#endif int geteuid() { return 1; } -#if !defined(NTDDI_VERSION) || (NTDDI_VERSION < NTDDI_LONGHORN) -int inet_pton(int af, const char *src, void *dst) +int insp_inet_pton(int af, const char *src, void *dst) { sockaddr_in sa; int len = sizeof(SOCKADDR); diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index ed0f461bc..e0cc77291 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -110,13 +110,15 @@ #define EINPROGRESS WSAEWOULDBLOCK #define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#if !defined(NTDDI_VERSION) || (NTDDI_VERSION < NTDDI_LONGHORN) /* Convert formatted (xxx.xxx.xxx.xxx) string to in_addr struct */ -CoreExport int inet_pton(int af, const char * src, void * dst); +CoreExport int insp_inet_pton(int af, const char * src, void * dst); /* Convert struct to formatted (xxx.xxx.xxx.xxx) string */ -CoreExport const char * inet_ntop(int af, const void * src, char * dst, socklen_t cnt); -#endif +CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, socklen_t cnt); + +/* we don't want to use windows' broken inet_pton and ntop */ +#define inet_pton insp_inet_pton +#define inet_ntop insp_inet_ntop /* Safe printf functions aren't defined in VC2003 */ #define snprintf _snprintf |