From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D49E6460DE for ; Fri, 4 Aug 2023 12:36:34 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A84F68C6DC; Fri, 4 Aug 2023 15:36:31 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7780368C5B3 for ; Fri, 4 Aug 2023 15:36:24 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 374CaNOL009706-374CaNOM009706 for ; Fri, 4 Aug 2023 15:36:23 +0300 Received: from foo.martin.st (host-97-144.parnet.fi [77.234.97.144]) by mail9.parnet.fi (Postfix) with ESMTPS id 8021EA146D for ; Fri, 4 Aug 2023 15:36:23 +0300 (EEST) Date: Fri, 4 Aug 2023 15:36:22 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH] os_support, network: Fix build failure on Windows with BZIP2 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 > --- > 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. > diff --git a/libavformat/network.h b/libavformat/network.h > index ca214087fc..06b6117fc7 100644 > --- a/libavformat/network.h > +++ b/libavformat/network.h > @@ -35,6 +35,7 @@ > #endif > #if HAVE_WINSOCK2_H > +#define WIN32_LEAN_AND_MEAN > #include > #include The diff seems very hard to apply. The diff stat above says that this shows a snippet of 6 lines originally, 7 lines after the modification - but in fact the diff only shows 4 lines originally and 5 lines after the modification. I don't know what has happened to the patch, but it makes it hard to apply automatically. > diff --git a/libavformat/os_support.c b/libavformat/os_support.c > index 15cea7fa5b..2de6a7c3d9 100644 > --- a/libavformat/os_support.c > +++ b/libavformat/os_support.c > @@ -34,11 +34,9 @@ > #if HAVE_SYS_TIME_H > #include > #endif /* HAVE_SYS_TIME_H */ > -#if HAVE_WINSOCK2_H > -#include > -#elif HAVE_SYS_SELECT_H > +#if HAVE_SYS_SELECT_H > #include > -#endif /* HAVE_WINSOCK2_H */ > +#endif /* HAVE_SYS_SELECT_H */ > #endif /* !HAVE_POLL_H */ > #include "network.h" I presume this is done to avoid touching winsock2.h here, as the headers that we've included already define this? // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".