[FFmpeg-devel] [PATCH] os_support, network: Fix build failure on Windows with BZIP2

Martin Storsjö martin at martin.st
Fri Aug 4 15:39:52 EEST 2023


On Fri, 4 Aug 2023, Martin Storsjö wrote:

> On Thu, 27 Jul 2023, L. E. Segovia wrote:
>
>> Including winsock2.h without WIN32_LEAN_AND_MEAN causes bzlib.h to parse
>> as nonsense, due to an instance of #define char small in rpcndr.h
>> (included transitively from windows.h).
>> 
>> See: https://stackoverflow.com/a/27794577
>> Signed-off-by: L. E. Segovia <amy at amyspark.me>
>> ---
>> libavformat/network.h    | 1 +
>> libavformat/os_support.c | 6 ++----
>> libavformat/os_support.h | 1 +
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> The change looks mostly reasonable to me I think, and WIN32_LEAN_AND_MEAN is 
> generally beneficial. I've got a couple comments below though.

Alternatively, I guess we could consider adding WIN32_LEAN_AND_MEAN in 
configure somewhere instead? That way we don't need to hunt down any 
potential stray includes of windows.h/winsock2.h if they are added 
elsewhere.

// Martin


More information about the ffmpeg-devel mailing list