From nobody Sun Feb 8 22:06:29 2026 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1546927135746184.89281419429722; Mon, 7 Jan 2019 21:58:55 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8300BC07EFC3; Tue, 8 Jan 2019 05:58:53 +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 46B3B60CD0; Tue, 8 Jan 2019 05:58:53 +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 6B0A73F954; Tue, 8 Jan 2019 05:58:49 +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 x085wmDO010579 for ; Tue, 8 Jan 2019 00:58:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 461395C21E; Tue, 8 Jan 2019 05:58:48 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-216.phx2.redhat.com [10.3.116.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 005405C20D; Tue, 8 Jan 2019 05:58:47 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Mon, 7 Jan 2019 23:58:41 -0600 Message-Id: <20190108055842.19272-2-eblake@redhat.com> In-Reply-To: <20190108055842.19272-1-eblake@redhat.com> References: <20190108055842.19272-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 Cc: jtomko@redhat.com Subject: [libvirt] [PATCH v2 1/2] examples: Drop event-test.c dependency on gnulib 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 08 Jan 2019 05:58:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Pulling in gnulib just for the header is rather expensive, especially since that header does not require us to link against gnulib. It's better to make the event-test example be standalone by just open-coding a more limited form of a verify() macro that depends on modern gcc (we have enough CI coverage that even though the verify is now a no-op in older setups, we will still notice if we fail to add an event - as a quick test, I still provoked a compile failure on Fedora 29 by deleting a line from domainEvents). Signed-off-by: Eric Blake --- examples/object-events/event-test.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/object-events/event-test.c b/examples/object-events/e= vent-test.c index 8499e0b38e..6694d3dffc 100644 --- a/examples/object-events/event-test.c +++ b/examples/object-events/event-test.c @@ -6,8 +6,6 @@ #include #include -#include - #define VIR_ENUM_SENTINELS #include @@ -17,6 +15,14 @@ #define STREQ(a, b) (strcmp(a, b) =3D=3D 0) #define NULLSTR(s) ((s) ? (s) : "") +#if (4 < __GNUC__ + (6 <=3D __GNUC_MINOR__) \ + && (201112L <=3D __STDC_VERSION__ || !defined __STRICT_ANSI__) \ + && !defined __cplusplus) +# define verify(cond) _Static_assert(cond, "verify (" #cond ")") +#else +# define verify(cond) +#endif + #ifndef ATTRIBUTE_UNUSED # define ATTRIBUTE_UNUSED __attribute__((__unused__)) #endif --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list