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