summaryrefslogtreecommitdiff
path: root/debian/fixheaders
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-11-26 14:11:14 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-11-26 14:11:14 +0300
commitcf9383412494964d6188fcf08a362c0c0f313afc (patch)
treebd9e6a5b3a63cbb155b81112c855c19cb5f2b314 /debian/fixheaders
downloadperl-cf9383412494964d6188fcf08a362c0c0f313afc.tar.gz
Import perl (5.30.0-9)debian/5.30.0-9debian
Diffstat (limited to 'debian/fixheaders')
-rw-r--r--debian/fixheaders24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/fixheaders b/debian/fixheaders
new file mode 100644
index 0000000..93ce13d
--- /dev/null
+++ b/debian/fixheaders
@@ -0,0 +1,24 @@
+#!perl -w
+
+#
+# Fix up generated .ph files
+#
+
+use strict;
+use File::Find;
+
+my @args = @ARGV;
+@ARGV = ();
+find sub { push @ARGV, $File::Find::name if -f and /\.ph$/ }, @args;
+
+$^I = '';
+
+die "$0: no headers under @args?\n" unless @ARGV;
+while (<>)
+{
+ # discard casts
+ s/(?<!\$sizeof\{)(&__const\s+)?\\'struct[^\\']+\\'[^;]*;/1;/g;
+ s/'char'\[\d+\]/1/g;
+
+ print;
+}