Including winsock2.h or windows.h without WIN32_LEAN_AND_MEAN cause bzlib.h to parse as nonsense, due to an instance of #define char small in rpcndr.h. See: https://stackoverflow.com/a/27794577
Unified · Split
| @@ -19,7 +19,6 @@ · 18 unmodified lines | ||
| 19 | 19 | #ifndef COMPAT_ATOMICS_WIN32_STDATOMIC_H |
| 20 | 20 | #define COMPAT_ATOMICS_WIN32_STDATOMIC_H |
| 21 | 21 | |
| 22 | −#define WIN32_LEAN_AND_MEAN | |
| 23 | 22 | #include <stddef.h> |
| 24 | 23 | #include <stdint.h> |
| 25 | 24 | #include <windows.h> |
| @@ -35,7 +35,6 @@ · 34 unmodified lines | ||
| 35 | 35 | * As most functions here are used without checking return values, |
| 36 | 36 | * only implement return values as necessary. */ |
| 37 | 37 | |
| 38 | −#define WIN32_LEAN_AND_MEAN | |
| 39 | 38 | #include <windows.h> |
| 40 | 39 | #include <process.h> |
| 41 | 40 | #include <time.h> |
| @@ -5666,6 +5666,7 @@ case $target_os in · 5665 unmodified lines | ||
| 5666 | 5666 | fi |
| 5667 | 5667 | ! enabled small && test_cmd $windres --version && enable gnu_windres |
| 5668 | 5668 | enabled x86_32 && check_ldflags -Wl,--large-address-aware |
| 5669 | + add_cppflags -DWIN32_LEAN_AND_MEAN | |
| 5669 | 5670 | shlibdir_default="$bindir_default" |
| 5670 | 5671 | SLIBPREF="" |
| 5671 | 5672 | SLIBSUF=".dll" |
| @@ -5716,6 +5717,7 @@ case $target_os in · 44 unmodified lines | ||
| 5716 | 5717 | fi |
| 5717 | 5718 | ! enabled small && test_cmd $windres --version && enable gnu_windres |
| 5718 | 5719 | enabled x86_32 && check_ldflags -LARGEADDRESSAWARE |
| 5720 | + add_cppflags -DWIN32_LEAN_AND_MEAN | |
| 5719 | 5721 | shlibdir_default="$bindir_default" |
| 5720 | 5722 | SLIBPREF="" |
| 5721 | 5723 | SLIBSUF=".dll" |
| @@ -5745,6 +5747,7 @@ case $target_os in · 23 unmodified lines | ||
| 5745 | 5747 | enabled x86_64 && objformat="win64" || objformat="win32" |
| 5746 | 5748 | enable dos_paths |
| 5747 | 5749 | ! enabled small && test_cmd $windres --version && enable gnu_windres |
| 5750 | + add_cppflags -DWIN32_LEAN_AND_MEAN | |
| 5748 | 5751 | add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 |
| 5749 | 5752 | ;; |
| 5750 | 5753 | *-dos|freedos|opendos) |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | #include "avdevice.h" |
| 28 | 28 | |
| 29 | 29 | #define COBJMACROS |
| 30 | −#define WIN32_LEAN_AND_MEAN | |
| 31 | 30 | #include <windows.h> |
| 32 | 31 | #define NO_DSHOW_STRSAFE |
| 33 | 32 | #include <dshow.h> |
| @@ -30,7 +30,6 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "config.h" |
| 31 | 31 | |
| 32 | 32 | #if HAVE_WINDOWS_H |
| 33 | −#define WIN32_LEAN_AND_MEAN | |
| 34 | 33 | #include <windows.h> |
| 35 | 34 | #endif |
| 36 | 35 | #if HAVE_OPENGL_GL3_H |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | #undef _WIN32_WINNT |
| 23 | 23 | #define _WIN32_WINNT 0x0A00 |
| 24 | 24 | #endif |
| 25 | −#define WIN32_LEAN_AND_MEAN | |
| 26 | 25 | |
| 27 | 26 | #include <windows.h> |
| 28 | 27 | |
| @@ -34,11 +34,9 @@ · 33 unmodified lines | ||
| 34 | 34 | #if HAVE_SYS_TIME_H |
| 35 | 35 | #include <sys/time.h> |
| 36 | 36 | #endif /* HAVE_SYS_TIME_H */ |
| 37 | −#if HAVE_WINSOCK2_H | |
| 38 | −#include <winsock2.h> | |
| 39 | −#elif HAVE_SYS_SELECT_H | |
| 37 | +#if HAVE_SYS_SELECT_H | |
| 40 | 38 | #include <sys/select.h> |
| 41 | −#endif /* HAVE_WINSOCK2_H */ | |
| 39 | +#endif /* HAVE_SYS_SELECT_H */ | |
| 42 | 40 | #endif /* !HAVE_POLL_H */ |
| 43 | 41 | |
| 44 | 42 | #include "network.h" |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | #ifdef _WIN32 |
| 23 | 23 | |
| 24 | −#define WIN32_LEAN_AND_MEAN | |
| 25 | 24 | #include <windows.h> |
| 26 | 25 | #include "mem.h" |
| 27 | 26 | |
| @@ -34,7 +34,6 @@ · 33 unmodified lines | ||
| 34 | 34 | #endif |
| 35 | 35 | #endif |
| 36 | 36 | #if HAVE_VIRTUALALLOC |
| 37 | −#define WIN32_LEAN_AND_MEAN | |
| 38 | 37 | #include <windows.h> |
| 39 | 38 | #endif |
| 40 | 39 | |