diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-03-13 22:23:42 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-03-13 22:23:42 +0000 |
commit | 1025835d802978a16af456deca7a95265ba13af9 (patch) | |
tree | ee461991f7b2e8be0c0a09fc35c2d4d21188c4e4 /src/include/ipxe/efi/import.pl | |
parent | cb37d92ff6915b511163e0160b5587cce4d9bb1c (diff) | |
download | ipxe-1025835d802978a16af456deca7a95265ba13af9.zip ipxe-1025835d802978a16af456deca7a95265ba13af9.tar.gz ipxe-1025835d802978a16af456deca7a95265ba13af9.tar.bz2 |
[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 2b5d3e9..9955146 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; |