stub inet_ntop and inet_pton function that mingw does not have

This commit is contained in:
Benjamin Sergeant 2021-03-14 14:25:40 -07:00
parent 461641f3d0
commit 85bcdaaec3
2 changed files with 20 additions and 0 deletions

View File

@ -6,6 +6,20 @@
#include "IXNetSystem.h"
// mingw does not have those
#if defined(_WIN32) && defined(__GNUC__)
const char * inet_ntop(int af, const void * restrict src, char * restrict dst, socklen_t size)
{
return nullptr;
}
int inet_pton(int af, const char * restrict src, void * restrict dst)
{
return -1;
}
#endif
namespace ix
{
bool initNetSystem()

View File

@ -47,6 +47,12 @@ struct pollfd {
#include <unistd.h>
#endif
// mingw does not have those
#if defined(_WIN32) && defined(__GNUC__)
const char * inet_ntop(int af, const void * restrict src, char * restrict dst, socklen_t size);
int inet_pton(int af, const char * restrict src, void * restrict dst);
#endif
namespace ix
{
#ifdef _WIN32