History

configure: Set WIN32_LEAN_AND_MEAN at configure time

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

L. E. Segovia committed 3 years ago

Commit ddc1cd51 parent c7049019 files · +5 −11Browse files

Unified · Split

9 files
  1. compat/atomics/win32/stdatomic.h +0 −1
  2. compat/w32pthreads.h +0 −1
  3. configure +3 −0
  4. libavdevice/dshow_capture.h +0 −1
  5. libavdevice/opengl_enc.c +0 −1
  6. libavfilter/vsrc_ddagrab.c +0 −1
  7. libavformat/os_support.c +2 −4
  8. libavutil/wchar_filename.h +0 −1
  9. libswscale/utils.c +0 −1
compat/atomics/win32/stdatomic.h+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 #ifndef COMPAT_ATOMICS_WIN32_STDATOMIC_H
2020 #define COMPAT_ATOMICS_WIN32_STDATOMIC_H
2121
22−#define WIN32_LEAN_AND_MEAN
2322 #include <stddef.h>
2423 #include <stdint.h>
2524 #include <windows.h>
compat/w32pthreads.h+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 * As most functions here are used without checking return values,
3636 * only implement return values as necessary. */
3737
38−#define WIN32_LEAN_AND_MEAN
3938 #include <windows.h>
4039 #include <process.h>
4140 #include <time.h>
configure+3−0
@@ -5666,6 +5666,7 @@ case $target_os in · 5665 unmodified lines
56665666 fi
56675667 ! enabled small && test_cmd $windres --version && enable gnu_windres
56685668 enabled x86_32 && check_ldflags -Wl,--large-address-aware
5669+ add_cppflags -DWIN32_LEAN_AND_MEAN
56695670 shlibdir_default="$bindir_default"
56705671 SLIBPREF=""
56715672 SLIBSUF=".dll"
@@ -5716,6 +5717,7 @@ case $target_os in · 44 unmodified lines
57165717 fi
57175718 ! enabled small && test_cmd $windres --version && enable gnu_windres
57185719 enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
5720+ add_cppflags -DWIN32_LEAN_AND_MEAN
57195721 shlibdir_default="$bindir_default"
57205722 SLIBPREF=""
57215723 SLIBSUF=".dll"
@@ -5745,6 +5747,7 @@ case $target_os in · 23 unmodified lines
57455747 enabled x86_64 && objformat="win64" || objformat="win32"
57465748 enable dos_paths
57475749 ! enabled small && test_cmd $windres --version && enable gnu_windres
5750+ add_cppflags -DWIN32_LEAN_AND_MEAN
57485751 add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
57495752 ;;
57505753 *-dos|freedos|opendos)
libavdevice/dshow_capture.h+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include "avdevice.h"
2828
2929 #define COBJMACROS
30−#define WIN32_LEAN_AND_MEAN
3130 #include <windows.h>
3231 #define NO_DSHOW_STRSAFE
3332 #include <dshow.h>
libavdevice/opengl_enc.c+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 #include "config.h"
3131
3232 #if HAVE_WINDOWS_H
33−#define WIN32_LEAN_AND_MEAN
3433 #include <windows.h>
3534 #endif
3635 #if HAVE_OPENGL_GL3_H
libavfilter/vsrc_ddagrab.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #undef _WIN32_WINNT
2323 #define _WIN32_WINNT 0x0A00
2424 #endif
25−#define WIN32_LEAN_AND_MEAN
2625
2726 #include <windows.h>
2827
libavformat/os_support.c+2−4
@@ -34,11 +34,9 @@ · 33 unmodified lines
3434 #if HAVE_SYS_TIME_H
3535 #include <sys/time.h>
3636 #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
4038 #include <sys/select.h>
41−#endif /* HAVE_WINSOCK2_H */
39+#endif /* HAVE_SYS_SELECT_H */
4240 #endif /* !HAVE_POLL_H */
4341
4442 #include "network.h"
libavutil/wchar_filename.h+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121
2222 #ifdef _WIN32
2323
24−#define WIN32_LEAN_AND_MEAN
2524 #include <windows.h>
2625 #include "mem.h"
2726
libswscale/utils.c+0−1
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 #endif
3535 #endif
3636 #if HAVE_VIRTUALALLOC
37−#define WIN32_LEAN_AND_MEAN
3837 #include <windows.h>
3938 #endif
4039

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t