[PATCH 2/6] build-aux: header-ifdef: Handle #pragma once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we see if, skip all remaining header guard checks

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 build-aux/header-ifdef.pl | 5 +++++
 1 file changed, 5 insertions(+)

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 {
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux