Skip to content

Commit

Permalink
Remove smartmatch usage from gen-crypt-h
Browse files Browse the repository at this point in the history
Needed for Perl 5.38
  • Loading branch information
akhuettel committed Jun 24, 2023
1 parent 213d2b7 commit 95d6e03
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions build-aux/scripts/gen-crypt-h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use v5.14; # implicit use strict, use feature ':5.14'
use warnings FATAL => 'all';
use utf8;
use open qw(:std :utf8);
no if $] >= 5.018, warnings => 'experimental::smartmatch';
no if $] >= 5.022, warnings => 'experimental::re_strict';
use if $] >= 5.022, re => 'strict';

Expand All @@ -37,22 +36,20 @@ sub process_config_h {
local $_;
while (<$fh>) {
chomp;
# Yes, 'given $_' is really required here.
given ($_) {
when ('#define HAVE_SYS_CDEFS_H 1') {
$have_sys_cdefs_h = 1;
}
when ('#define HAVE_SYS_CDEFS_BEGIN_END_DECLS 1') {
$have_sys_cdefs_begin_end_decls = 1;
}
when ('#define HAVE_SYS_CDEFS_THROW 1') {
$have_sys_cdefs_throw = 1;
}
when (/^#define PACKAGE_VERSION "((\d+)\.(\d+)\.\d+)"$/) {
$substs{XCRYPT_VERSION_STR} = $1;
$substs{XCRYPT_VERSION_MAJOR} = $2;
$substs{XCRYPT_VERSION_MINOR} = $3;
}

if ($_ eq '#define HAVE_SYS_CDEFS_H 1') {
$have_sys_cdefs_h = 1;
}
elsif ($_ eq '#define HAVE_SYS_CDEFS_BEGIN_END_DECLS 1') {
$have_sys_cdefs_begin_end_decls = 1;
}
elsif ($_ eq '#define HAVE_SYS_CDEFS_THROW 1') {
$have_sys_cdefs_throw = 1;
}
elsif (/^#define PACKAGE_VERSION "((\d+)\.(\d+)\.\d+)"$/) {
$substs{XCRYPT_VERSION_STR} = $1;
$substs{XCRYPT_VERSION_MAJOR} = $2;
$substs{XCRYPT_VERSION_MINOR} = $3;
}
}

Expand Down

0 comments on commit 95d6e03

Please sign in to comment.