dynapi: Make gendynapi.pl work on older Perl releases.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 05 Oct 2019 20:19:10 -0400
changeset 13105db9d0d0b7ebc
parent 13104 e896a6e84cf8
child 13106 11be7c38d220
dynapi: Make gendynapi.pl work on older Perl releases.
src/dynapi/gendynapi.pl
     1.1 --- a/src/dynapi/gendynapi.pl	Wed Oct 02 14:55:02 2019 -0400
     1.2 +++ b/src/dynapi/gendynapi.pl	Sat Oct 05 20:19:10 2019 -0400
     1.3 @@ -49,9 +49,9 @@
     1.4  open(SDL_DYNAPI_OVERRIDES_H, '>>', $sdl_dynapi_overrides_h) or die("Can't open $sdl_dynapi_overrides_h: $!\n");
     1.5  
     1.6  opendir(HEADERS, 'include') or die("Can't open include dir: $!\n");
     1.7 -while (readdir(HEADERS)) {
     1.8 -    next if not /\.h\Z/;
     1.9 -    my $header = "include/$_";
    1.10 +while (my $d = readdir(HEADERS)) {
    1.11 +    next if not $d =~ /\.h\Z/;
    1.12 +    my $header = "include/$d";
    1.13      open(HEADER, '<', $header) or die("Can't open $header: $!\n");
    1.14      while (<HEADER>) {
    1.15          chomp;