From patchwork Wed Apr 3 21:52:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161710 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp833159jan; Wed, 3 Apr 2019 14:53:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqweH8P/hPo5SOCZunyu3WcTWpqq817b5kaY5j9C0WlDw85E52UpvQ6yqi/vv8QbhEEamMWV X-Received: by 2002:a37:aa11:: with SMTP id t17mr2149017qke.193.1554328393194; Wed, 03 Apr 2019 14:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554328393; cv=none; d=google.com; s=arc-20160816; b=Cv1cx9EQW5Ju/Dv/chX/5EEbqouvf23ewOxmeNZKLOvikv+HF7pms2r8jgi3QVoj3L JdfikFWjBVZt1+qTnAL3gKbPVMtV+XpYtpPgYwSSAgwIoBUac6l90O9U2Wz1Yq4Vc+Xr MvBr/piPprkc2ApASDn9/alG7yTJ+gihOQ8+gRsN7+byhY/DZzQzVZ9VkAmJTt2H2wf0 ziVVMDHldEEDYYWXmCqBxwbjnFwO0jaUIV+XExnizXAHTYW9DdosjFOrOF1bydmrAJrh /UXLwJKaZ2GpMu3b+Q2WJ5zRpEneWYkbPUui/xSqcA6fa8Bv4zB/A/HA+vkJeCyQFD+J Ildg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=LT2c77ARlRBxITHCOBwt2g/6cIH4rgFTZFk8+Zvg5iA=; b=pwGi1CaHmzxKAzrjnxXDo+tXVAXxiBNDu/nIv4tBhds7BWTmoU2iXW0toAjvRp5pFg RKoafFknbm0DxztIvUSShTSfEMVvXBFe/Cc4nBPXBlssbHGHOmfP/2FmntOerxwYtvJe G1gx5EIO0Hjh9AI9CKUvhpOhGa1igUKTSMaD5Qjty210/ixlR920XSCu74NuQ+b815nH 7pZb0a856fI5qLM0jzquLIn4o02e7rAgfx+oTahb7nokKYMMHWy8ftK1zNw464fo/wQW ZEqoHCTxVaER+AaRjFHXglgTKKBJbm6z59TdqnXu9MKxdaNYnZFsU2QZgwsa7yXRGPw3 36EA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id w7si2451285qki.216.2019.04.03.14.53.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 14:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAAAE316891B; Wed, 3 Apr 2019 21:53:11 +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 C099F643E7; Wed, 3 Apr 2019 21:53:11 +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 8346D41F3E; Wed, 3 Apr 2019 21:53:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x33Lqv5e013215 for ; Wed, 3 Apr 2019 17:52:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 89E10BA9B; Wed, 3 Apr 2019 21:52:57 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-120-38.rdu2.redhat.com [10.10.120.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0989B6B2D8; Wed, 3 Apr 2019 21:52:55 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 3 Apr 2019 17:52:44 -0400 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] build-aux: header-ifdef: Handle #pragma once 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 03 Apr 2019 21:53:12 +0000 (UTC) If we see if, skip all remaining header guard checks Signed-off-by: Cole Robinson --- build-aux/header-ifdef.pl | 5 +++++ 1 file changed, 5 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/build-aux/header-ifdef.pl b/build-aux/header-ifdef.pl index 297696eb70..401f25fb81 100644 --- a/build-aux/header-ifdef.pl +++ b/build-aux/header-ifdef.pl @@ -32,6 +32,7 @@ my $STATE_GUARD_START = 6; my $STATE_GUARD_DEFINE = 7; my $STATE_GUARD_END = 8; my $STATE_EOF = 9; +my $STATE_PRAGMA = 10; my $file = " "; my $ret = 0; @@ -132,6 +133,8 @@ while (<>) { } elsif ($state == $STATE_GUARD_START) { if (/^$/) { &mistake("$file: too many blank lines after copyright header"); + } elsif(/#pragma once/) { + $state = $STATE_PRAGMA; } elsif (/#ifndef $ifdef$/) { $state = $STATE_GUARD_DEFINE; } else { @@ -147,6 +150,8 @@ while (<>) { if (m,#endif /\* $ifdef \*/$,) { $state = $STATE_EOF; } + } elsif ($state == $STATE_PRAGMA) { + next; } elsif ($state == $STATE_EOF) { die "$file: unexpected content after '#endif /* $ifdef */'"; } else {