From nobody Sat May 4 12:34:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564601443; cv=none; d=zoho.com; s=zohoarc; b=hgcSC6e+FTeqvQucKMC5SAK+TpwWEy90IfVKDcXS2Yc7s535kTr44OUArHBKHzNEv9uoHA3OKUs+5vlXZRpe+BoDdQTX5y4BnsvMVtlF3m4H3QmqvBkg4uaBKKsEZznBfJvHTpak1nO625zj1wh2HUKZ/YttZYSRbHY/Hg/qyWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564601443; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=+xOGKGBt+q5NwrAJh+SY2ez3tK5UrFIrC3ozUL9Hg40=; b=b4VSlWmQ8pgoDoShnV4tdldKpmzqrtwRqB0Yl6Rhp32hxkHIngaKX8NZQYipUvOuVMeDQWvcUTB96NnScjOxUCg5o3GrJEBeeqTFg5JUAo5Ikb1SgZ0ahauFzYQWfvpsKD8VmattMnNZ5MEN1D4mLTdNZq4m5evow0nVYl0D5qw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564601443358747.2928771841472; Wed, 31 Jul 2019 12:30:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D84DAC049E10; Wed, 31 Jul 2019 19:30:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CECEC1001B09; Wed, 31 Jul 2019 19:30:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8C2D241F53; Wed, 31 Jul 2019 19:30:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6VJUYYf022977 for ; Wed, 31 Jul 2019 15:30:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id D8D5D5C21A; Wed, 31 Jul 2019 19:30:34 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-93.phx2.redhat.com [10.3.116.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FED35C219 for ; Wed, 31 Jul 2019 19:30:32 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Wed, 31 Jul 2019 14:30:31 -0500 Message-Id: <20190731193031.11875-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] build: Solve mingw build clash with DATADIR X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 31 Jul 2019 19:30:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Commit fed58d83 was a hack to fix a mingw build failure due to header inclusion order resulting in a clash over the use of DATADIR, by repeating a trick made several other times in the past of tweaking inclusion order until it goes away. Better is to revert that, and instead use pragmas to avoid the clash in the first place, regardless of header ordering, solving it for everyone in the future. Signed-off-by: Eric Blake Reviewed-by: Michal Privoznik --- I tested that both gcc and clang on F29 support this; but it will take a full CI run to see if everywhere else is okay with it. Thus, it is not 5.6 material. src/util/viratomic.h | 3 +++ src/conf/checkpoint_conf.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/viratomic.h b/src/util/viratomic.h index 35800dafcd..c6e7668324 100644 --- a/src/util/viratomic.h +++ b/src/util/viratomic.h @@ -218,7 +218,10 @@ VIR_STATIC unsigned int virAtomicIntXor(volatile unsig= ned int *atomic, # ifdef VIR_ATOMIC_OPS_WIN32 +# pragma push_macro("DATADIR") /* If "configmake.h" was included first */ +# undef DATADIR # include +# pragma pop_macro("DATADIR") # include # include # if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 5ce4cc4853..5f4c275dd8 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -21,8 +21,6 @@ #include -#include - #include "configmake.h" #include "internal.h" #include "virbitmap.h" --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list