aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mingw.h1
-rw-r--r--win32/Kbuild1
-rw-r--r--win32/net.c11
3 files changed, 13 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 53a0a0d67..d61d87bf3 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -15,6 +15,7 @@ typedef int pid_t;
15 */ 15 */
16static inline unsigned int git_ntohl(unsigned int x) { return (unsigned int)ntohl(x); } 16static inline unsigned int git_ntohl(unsigned int x) { return (unsigned int)ntohl(x); }
17#define ntohl git_ntohl 17#define ntohl git_ntohl
18int inet_aton(const char *cp, struct in_addr *inp);
18 19
19/* 20/*
20 * fcntl.h 21 * fcntl.h
diff --git a/win32/Kbuild b/win32/Kbuild
index a4a7f32d4..bc005c23a 100644
--- a/win32/Kbuild
+++ b/win32/Kbuild
@@ -9,5 +9,6 @@ lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o
9lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o 9lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o
10lib-$(CONFIG_PLATFORM_MINGW32) += process.o 10lib-$(CONFIG_PLATFORM_MINGW32) += process.o
11lib-$(CONFIG_PLATFORM_MINGW32) += regex.o 11lib-$(CONFIG_PLATFORM_MINGW32) += regex.o
12lib-$(CONFIG_WIN32_NET) += net.o
12lib-$(CONFIG_PLATFORM_MINGW32) += termios.o 13lib-$(CONFIG_PLATFORM_MINGW32) += termios.o
13lib-$(CONFIG_PLATFORM_MINGW32) += winansi.o 14lib-$(CONFIG_PLATFORM_MINGW32) += winansi.o
diff --git a/win32/net.c b/win32/net.c
new file mode 100644
index 000000000..93e19ae5c
--- /dev/null
+++ b/win32/net.c
@@ -0,0 +1,11 @@
1#include "libbb.h"
2
3int inet_aton(const char *cp, struct in_addr *inp)
4{
5 unsigned long val = inet_addr(cp);
6
7 if (val == INADDR_NONE)
8 return 0;
9 inp->S_un.S_addr = val;
10 return 1;
11}