fnsince.pl: Make this work with SDL3.

This commit is contained in:
Ryan C. Gordon 2022-11-22 17:39:38 -05:00
parent ecc4b8773c
commit 8b18b09027
No known key found for this signature in database
GPG key ID: FA148B892AB48044

View file

@ -19,12 +19,12 @@ open(PIPEFH, '-|', 'git tag -l') or die "Failed to read git release tags: $!\n";
while (<PIPEFH>) { while (<PIPEFH>) {
chomp; chomp;
if (/\Arelease\-(.*?)\Z/) { if (/\Arelease\-(.*?)\Z/) {
# After 2.24.x, ignore anything that isn't a x.y.0 release. # Ignore anything that isn't a x.y.0 release.
# We moved to bugfix-only point releases there, so make sure new APIs # Make sure new APIs are assigned to the next minor version and ignore the patch versions.
# are assigned to the next minor version and ignore the patch versions.
my $ver = $1; my $ver = $1;
my @versplit = split /\./, $ver; my @versplit = split /\./, $ver;
next if (scalar(@versplit) > 2) && (($versplit[0] > 2) || (($versplit[0] == 2) && ($versplit[1] >= 24))) && ($versplit[2] != 0); next if (scalar(@versplit) < 1) || ($versplit[0] != 3); # Ignore anything that isn't an SDL3 release.
next if (scalar(@versplit) < 3) || ($versplit[2] != 0);
# Consider this release version. # Consider this release version.
push @unsorted_releases, $ver; push @unsorted_releases, $ver;
@ -52,13 +52,12 @@ my @releases = sort {
return 0; # still here? They matched completely?! return 0; # still here? They matched completely?!
} @unsorted_releases; } @unsorted_releases;
my $current_release = 'in-development';
my $next_release = '3.0.0'; # valid until we actually ship something. :)
if (scalar(@releases) > 0) {
# this happens to work for how SDL versions things at the moment. # this happens to work for how SDL versions things at the moment.
my $current_release = $releases[-1]; $current_release = $releases[-1];
my $next_release;
if ($current_release eq '2.0.22') { # Hack for our jump from 2.0.22 to 2.24.0...
$next_release = '2.24.0';
} else {
my @current_release_segments = split /\./, $current_release; my @current_release_segments = split /\./, $current_release;
@current_release_segments[1] = '' . ($current_release_segments[1] + 2); @current_release_segments[1] = '' . ($current_release_segments[1] + 2);
$next_release = join('.', @current_release_segments); $next_release = join('.', @current_release_segments);
@ -76,8 +75,6 @@ push @releases, 'HEAD';
my %funcs = (); my %funcs = ();
foreach my $release (@releases) { foreach my $release (@releases) {
#print("Checking $release...\n"); #print("Checking $release...\n");
next if ($release eq '2.0.0') || ($release eq '2.0.1'); # no dynapi before 2.0.2
my $assigned_release = ($release eq '2.0.2') ? '2.0.0' : $release; # assume everything in 2.0.2--first with dynapi--was there since 2.0.0. We'll fix it up later.
my $tag = ($release eq 'HEAD') ? $release : "release-$release"; my $tag = ($release eq 'HEAD') ? $release : "release-$release";
my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h"; my $blobname = "$tag:src/dynapi/SDL_dynapi_overrides.h";
open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n"; open(PIPEFH, '-|', "git show '$blobname'") or die "Failed to read git blob '$blobname': $!\n";
@ -85,40 +82,12 @@ foreach my $release (@releases) {
chomp; chomp;
if (/\A\#define\s+(SDL_.*?)\s+SDL_.*?_REAL\Z/) { if (/\A\#define\s+(SDL_.*?)\s+SDL_.*?_REAL\Z/) {
my $fn = $1; my $fn = $1;
$funcs{$fn} = $assigned_release if not defined $funcs{$fn}; $funcs{$fn} = $release if not defined $funcs{$fn};
} }
} }
close(PIPEFH); close(PIPEFH);
} }
# Fixup the handful of functions that were added in 2.0.1 and 2.0.2 that we
# didn't have dynapi revision data about...
$funcs{'SDL_GetSystemRAM'} = '2.0.1';
$funcs{'SDL_GetBasePath'} = '2.0.1';
$funcs{'SDL_GetPrefPath'} = '2.0.1';
$funcs{'SDL_UpdateYUVTexture'} = '2.0.1';
$funcs{'SDL_GL_GetDrawableSize'} = '2.0.1';
$funcs{'SDL_Direct3D9GetAdapterIndex'} = '2.0.1';
$funcs{'SDL_RenderGetD3D9Device'} = '2.0.1';
$funcs{'SDL_RegisterApp'} = '2.0.2';
$funcs{'SDL_UnregisterApp'} = '2.0.2';
$funcs{'SDL_GetAssertionHandler'} = '2.0.2';
$funcs{'SDL_GetDefaultAssertionHandler'} = '2.0.2';
$funcs{'SDL_AtomicAdd'} = '2.0.2';
$funcs{'SDL_AtomicGet'} = '2.0.2';
$funcs{'SDL_AtomicGetPtr'} = '2.0.2';
$funcs{'SDL_AtomicSet'} = '2.0.2';
$funcs{'SDL_AtomicSetPtr'} = '2.0.2';
$funcs{'SDL_HasAVX'} = '2.0.2';
$funcs{'SDL_GameControllerAddMappingsFromRW'} = '2.0.2';
$funcs{'SDL_acos'} = '2.0.2';
$funcs{'SDL_asin'} = '2.0.2';
$funcs{'SDL_vsscanf'} = '2.0.2';
$funcs{'SDL_DetachThread'} = '2.0.2';
$funcs{'SDL_GL_ResetAttributes'} = '2.0.2';
$funcs{'SDL_DXGIGetOutputInfo'} = '2.0.2';
if (not defined $wikipath) { if (not defined $wikipath) {
foreach my $release (@releases) { foreach my $release (@releases) {
foreach my $fn (sort keys %funcs) { foreach my $fn (sort keys %funcs) {