diff options
| author | Michael Brown | 2013-03-13 23:23:42 +0100 |
|---|---|---|
| committer | Michael Brown | 2013-03-13 23:23:42 +0100 |
| commit | 1025835d802978a16af456deca7a95265ba13af9 (patch) | |
| tree | ee461991f7b2e8be0c0a09fc35c2d4d21188c4e4 /src/include/ipxe/efi/import.pl | |
| parent | [romprefix] Display only one "Ctrl-B" prompt per PCI device during POST (diff) | |
| download | ipxe-1025835d802978a16af456deca7a95265ba13af9.tar.gz ipxe-1025835d802978a16af456deca7a95265ba13af9.tar.xz ipxe-1025835d802978a16af456deca7a95265ba13af9.zip | |
[efi] Update to latest EDK2 headers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/import.pl')
| -rwxr-xr-x | src/include/ipxe/efi/import.pl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/include/ipxe/efi/import.pl b/src/include/ipxe/efi/import.pl index 2b5d3e939..995514681 100755 --- a/src/include/ipxe/efi/import.pl +++ b/src/include/ipxe/efi/import.pl @@ -59,6 +59,7 @@ sub try_import_file { open my $outfh, ">$outfile" or die "Could not open $outfile: $!\n"; my @dependencies = (); my $licence; + my $maybe_guard; my $guard; while ( <$infh> ) { # Strip CR and trailing whitespace @@ -77,10 +78,16 @@ sub try_import_file { # Write out line print $outfh "$_\n"; # Apply FILE_LICENCE() immediately after include guard - if ( /^\#define\s+_?_\S+_H_?_$/ ) { - die "Duplicate header guard detected in $infile\n" if $guard; - $guard = 1; - print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence; + if ( defined $maybe_guard ) { + if ( /^\#define\s+_?_${maybe_guard}_?_$/ ) { + die "Duplicate header guard detected in $infile\n" if $guard; + $guard = $maybe_guard; + print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence; + } + undef $maybe_guard; + } + if ( /^#ifndef\s+_?_(\S+)_?_/ ) { + $maybe_guard = $1; } } close $outfh; |
