From: "L. E. Segovia" <amy@amyspark.me> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] os_support, network: Fix build failure on Windows with BZIP2 Date: Thu, 27 Jul 2023 15:51:19 -0300 Message-ID: <f4740c20-da0f-4f98-87ab-79407d41e7ef@amyspark.me> (raw) 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@amyspark.me> --- libavformat/network.h | 1 + libavformat/os_support.c | 6 ++---- libavformat/os_support.h | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) 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 <winsock2.h> #include <ws2tcpip.h> 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 <sys/time.h> #endif /* HAVE_SYS_TIME_H */ -#if HAVE_WINSOCK2_H -#include <winsock2.h> -#elif HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H #include <sys/select.h> -#endif /* HAVE_WINSOCK2_H */ +#endif /* HAVE_SYS_SELECT_H */ #endif /* !HAVE_POLL_H */ #include "network.h" diff --git a/libavformat/os_support.h b/libavformat/os_support.h index f2ff38e23b..5bdd275d70 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -140,6 +140,7 @@ typedef int socklen_t; typedef unsigned long nfds_t; #if HAVE_WINSOCK2_H +#define WIN32_LEAN_AND_MEAN #include <winsock2.h> #endif #if !HAVE_STRUCT_POLLFD -- 2.41.0 _______________________________________________ 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".
next reply other threads:[~2023-07-27 18:51 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-27 18:51 L. E. Segovia [this message] 2023-07-29 18:48 ` [FFmpeg-devel] [PATCH v2] " L. E. Segovia 2023-08-04 12:36 ` [FFmpeg-devel] [PATCH] " Martin Storsjö 2023-08-04 12:39 ` Martin Storsjö 2023-08-05 13:00 ` L. E. Segovia 2023-08-05 20:47 ` [FFmpeg-devel] [PATCH v3 0/1] configure: Set WIN32_LEAN_AND_MEAN at configure time L. E. Segovia 2023-08-14 11:53 ` [FFmpeg-devel] [PATCH v4 " L. E. Segovia [not found] ` <cover.1692013786.git.amy@amyspark.me> 2023-08-14 11:53 ` [FFmpeg-devel] [PATCH v4 1/1] " L. E. Segovia 2023-08-14 19:58 ` Martin Storsjö 2023-08-19 15:31 ` Gyan Doshi 2023-08-19 21:12 ` Martin Storsjö [not found] ` <cover.1691268056.git.amy@amyspark.me> 2023-08-05 20:47 ` [FFmpeg-devel] [PATCH v3 " L. E. Segovia 2023-08-14 11:30 ` Martin Storsjö
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=f4740c20-da0f-4f98-87ab-79407d41e7ef@amyspark.me \ --to=amy@amyspark.me \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git