Skip to content

Commit

Permalink
Remove extraneous variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Robinson committed Dec 8, 2024
1 parent aec8468 commit 1a28272
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bin/make_vers
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,20 @@ sub print_startprotect ($$) {
#
sub print_checkoptions ($) {
my $fh = shift; # File handle for output file
my $curr_idx; # Current API version index

# Print the option checking
print $fh "\n\n/* Issue error if contradicting macros have been defined. */\n";
print $fh "/* (Can't use an older (deprecated) API version if deprecated symbols have been disabled) */\n";

# Print the #ifdef
print $fh "#if (";
$curr_idx = 0;
for my $i (0 .. $#versions - 1) {

print $fh "defined(H5_USE_", $versions[$i], "_API)";

$curr_idx++;
if ($curr_idx < @versions - 1) {
# -2 because we're ignoring the last version in the loop, and the
# last version we DO write out can't have an || after it
if ($i < @versions - 2) {
print $fh " || ";
}
}
Expand All @@ -137,12 +136,10 @@ sub print_checkoptions ($) {

# Print the #endif
print $fh "#endif /* (";
$curr_idx = 0;
for my $i (0 .. $#versions - 1) {
print $fh "defined(H5_USE_", $versions[$i], "_API)";

$curr_idx++;
if ($curr_idx < @versions - 1) {
if ($i < @versions - 2) {
print $fh " || ";
}
}
Expand Down

0 comments on commit 1a28272

Please sign in to comment.