diff options
-rw-r--r-- | compat/mingw.c | 7 | ||||
-rw-r--r-- | compat/mingw.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 6ef0cc4f99..8e17daeac3 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1321,6 +1321,13 @@ static void ensure_socket_initialization(void) initialized = 1; } +#undef gethostname +int mingw_gethostname(char *name, int namelen) +{ + ensure_socket_initialization(); + return gethostname(name, namelen); +} + #undef gethostbyname struct hostent *mingw_gethostbyname(const char *host) { diff --git a/compat/mingw.h b/compat/mingw.h index ce9dd980eb..fecf0d0776 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -190,6 +190,9 @@ char *mingw_getcwd(char *pointer, int len); char *mingw_getenv(const char *name); #define getenv mingw_getenv +int mingw_gethostname(char *host, int namelen); +#define gethostname mingw_gethostname + struct hostent *mingw_gethostbyname(const char *host); #define gethostbyname mingw_gethostbyname |