diff options
| author | Ron Yorston <rmy@pobox.com> | 2021-02-20 13:07:14 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2021-02-21 09:51:08 +0000 |
| commit | 4bca7987f38b24867d93efc4a11a1ef661734056 (patch) | |
| tree | 5888b245783bf99ed4347320cce87feb5ee7cf4f | |
| parent | 5369ddc1db797a96cced91bd467d172d41d41f9d (diff) | |
| download | busybox-w32-4bca7987f38b24867d93efc4a11a1ef661734056.tar.gz busybox-w32-4bca7987f38b24867d93efc4a11a1ef661734056.tar.bz2 busybox-w32-4bca7987f38b24867d93efc4a11a1ef661734056.zip | |
win32: fixes to build on Windows/MSYS2/mingw-w64
To investigate GitHub issue #200 it was necessary to perform
build on Window using the MSYS2/mingw-w64 toolchain. This
threw up some issues:
- The settings for _WIN32_WINNT and __USE_MINGW_ANSI_STDIO differ
from those in Fedora resulting in compiler errors and warnings.
Force the defaults I'm used to.
- The workaround to allow native compilation of mconf.c was broken
by a subsequent upstream change. Make it work again.
| -rw-r--r-- | include/libbb.h | 3 | ||||
| -rw-r--r-- | include/platform.h | 5 | ||||
| -rw-r--r-- | scripts/kconfig/mconf.c | 2 | ||||
| -rw-r--r-- | win32/poll.c | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h index c4734e86d..5e1d1fc5b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -144,9 +144,6 @@ | |||
| 144 | #elif defined __APPLE__ | 144 | #elif defined __APPLE__ |
| 145 | # include <netinet/in.h> | 145 | # include <netinet/in.h> |
| 146 | #elif ENABLE_PLATFORM_MINGW32 | 146 | #elif ENABLE_PLATFORM_MINGW32 |
| 147 | # ifndef WINVER | ||
| 148 | # define WINVER 0x0501 | ||
| 149 | # endif | ||
| 150 | # include <winsock2.h> | 147 | # include <winsock2.h> |
| 151 | # include <ws2tcpip.h> | 148 | # include <ws2tcpip.h> |
| 152 | #else | 149 | #else |
diff --git a/include/platform.h b/include/platform.h index ea97d2682..0fc270fab 100644 --- a/include/platform.h +++ b/include/platform.h | |||
| @@ -10,6 +10,11 @@ | |||
| 10 | #if ENABLE_PLATFORM_MINGW32 | 10 | #if ENABLE_PLATFORM_MINGW32 |
| 11 | # if !defined(__MINGW32__) /* HOSTCC is called */ | 11 | # if !defined(__MINGW32__) /* HOSTCC is called */ |
| 12 | # undef ENABLE_PLATFORM_MINGW32 | 12 | # undef ENABLE_PLATFORM_MINGW32 |
| 13 | # else | ||
| 14 | # undef __USE_MINGW_ANSI_STDIO | ||
| 15 | # define __USE_MINGW_ANSI_STDIO 0 | ||
| 16 | # undef _WIN32_WINNT | ||
| 17 | # define _WIN32_WINNT 0x502 | ||
| 13 | # endif | 18 | # endif |
| 14 | #else | 19 | #else |
| 15 | # if defined(__MINGW32__) | 20 | # if defined(__MINGW32__) |
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index cda0473ac..d945f2cd5 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -31,9 +31,11 @@ | |||
| 31 | #include <unistd.h> | 31 | #include <unistd.h> |
| 32 | #include <locale.h> | 32 | #include <locale.h> |
| 33 | 33 | ||
| 34 | #ifndef __MINGW32__ | ||
| 34 | #ifndef SIGWINCH | 35 | #ifndef SIGWINCH |
| 35 | #define SIGWINCH 28 | 36 | #define SIGWINCH 28 |
| 36 | #endif | 37 | #endif |
| 38 | #endif | ||
| 37 | 39 | ||
| 38 | #define LKC_DIRECT_LINK | 40 | #define LKC_DIRECT_LINK |
| 39 | #include "lkc.h" | 41 | #include "lkc.h" |
diff --git a/win32/poll.c b/win32/poll.c index 3294fdc96..8f16d93e9 100644 --- a/win32/poll.c +++ b/win32/poll.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | # pragma GCC diagnostic ignored "-Wtype-limits" | 23 | # pragma GCC diagnostic ignored "-Wtype-limits" |
| 24 | #endif | 24 | #endif |
| 25 | 25 | ||
| 26 | #include "libbb.h" | ||
| 26 | #include <malloc.h> | 27 | #include <malloc.h> |
| 27 | 28 | ||
| 28 | #include <sys/types.h> | 29 | #include <sys/types.h> |
| @@ -37,9 +38,6 @@ | |||
| 37 | #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ | 38 | #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ |
| 38 | # define WINDOWS_NATIVE | 39 | # define WINDOWS_NATIVE |
| 39 | # define WIN32_NATIVE | 40 | # define WIN32_NATIVE |
| 40 | # if defined (_MSC_VER) | ||
| 41 | # define _WIN32_WINNT 0x0502 | ||
| 42 | # endif | ||
| 43 | # include <winsock2.h> | 41 | # include <winsock2.h> |
| 44 | # include <windows.h> | 42 | # include <windows.h> |
| 45 | # include <io.h> | 43 | # include <io.h> |
