From patchwork Sat Jul 29 18:48:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 43023 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp1478736pzg; Sat, 29 Jul 2023 11:49:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEd0sIRGfHe1I+K7nFYR0y4NHvHYXksJtUDjxY8UlqQSzQG6WD7W9zJbDd8z0bfbnp4ddDy X-Received: by 2002:a17:906:76cf:b0:991:bf04:2047 with SMTP id q15-20020a17090676cf00b00991bf042047mr3077454ejn.14.1690656541284; Sat, 29 Jul 2023 11:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690656541; cv=none; d=google.com; s=arc-20160816; b=I0lalNtBUoMGF1J7q3bmZTQvgjhGCxVn8AXEnwvcTM1DpjWqzCwLhvP3bRfKCYHu6o JOHCfEaB8gcCZR5Lg4Liruz6t7BszSrwvy4gISgvSjLIK1mNe3dFXp/iNHYPAUz8WirW z9IMra6McsFkPVBdxEiMkYc9pJNzLYHlUeSwtJBK2sGzUDc2paDRLfDbpUBFyFc2Qrtf 6iS14Ne9U6iAf90GTX8I9HnMHZBfYrjIYikQ1QUgOg2vlKEO+s8t1GZq4FfsZUeWImw1 XOKIIDAcCFabzwtmYKqEgOoV5Tlb854ex0QTNUHwFPJKXAgc7UVAw5IBcnby/bZ7D5Di mytQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:in-reply-to:content-language:references:to:from :user-agent:mime-version:date:message-id:dkim-signature:delivered-to; bh=wDlk9g385/0Ev43yv9BJ0dNV0yYtVRVMn1qw1rnJrto=; fh=ESc3qdU44dcJCICb6LyFA8dwP9m5t2kvrhWue0vN394=; b=q2D2Qvb7nnv9RQk8xS8Ro0xeBNglQeq9LZQFVE9CnOGSen0oipNtBcjHb+wXzpa4mK o2HO+5MIeLpwfV44t1tZg1MQiK3DSq+9t7V6dqyHkiIUJJAGVuLYh3FgTCjI5IoRQ9jN MoRJPDjXHNZTjIoujdOnNztD5ZDlrgbOoN6unao10hezbraLaD2jMIgQKx31g8WNDTCM 1P6p7JLNhOlnL1V3lmGivtUKdFkzdorxbGWqwXu3X8eNHy3kCMnGps1dveAD9qod6zKJ H7X350ye9lQg/K7SkmUEB6GdQfEUPj2Fsv0NO96Rw0KCo9IE4J/99zGZWVq8fo92IMYL OAEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=AQ8dp5Yw; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d16-20020a170906041000b0099351214a8esi333220eja.645.2023.07.29.11.49.00; Sat, 29 Jul 2023 11:49:01 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=AQ8dp5Yw; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0744C68C884; Sat, 29 Jul 2023 21:48:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9FEF768BEC6 for ; Sat, 29 Jul 2023 21:48:51 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id F3A78C0003; Sat, 29 Jul 2023 18:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1690656531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B23jA/vWyBvBKYUYKihC749v8DDAL9GZwVvLh7JPnNQ=; b=AQ8dp5Ywc5pN2wvBW/UmHYLHxUluBTivoEOH1SH3CdUgB2gasgHRRKJyuhghNN4ojcgPwq cQf2uCNLDlSeTldFlOXV+lhEVrIPSdcBlJGwoDqH/ohWKf4BuYJuICx77YaAXrFgIIkWgw 8COGgz8l7KEnL2QMyDgd8+B8hQF9McEsV8XPxj9UgI1FF+SxyR+9+H7HtWuQUCzDBDmFcI 18CBYu4G+mW986DgkStUJmq1Xygd+WlFmjcic0NVT6+Q66cNeo4duXCGUx3Vrah0GRU546 MDToZV/VC9i0z/AIMchd9lcccAA9hbU5zuvYfQC6iodXgPMNp2srgtPjeMt9DQ== Message-ID: Date: Sat, 29 Jul 2023 15:48:45 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US In-Reply-To: X-GND-Sasl: amy@amyspark.me Subject: [FFmpeg-devel] [PATCH v2] 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: zy8vqL7zYKLX 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(-) 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 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" 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 #endif #if !HAVE_STRUCT_POLLFD