| Revision: | 1.3 |
| Committed: | Tue Dec 29 15:16:28 2020 UTC (5 years, 8 months ago) by root |
| Branch: | MAIN |
| CVS Tags: | rel-4_81, rel-4_80, rel-4_78, rel-4_79, rel-4_74, rel-4_75, rel-4_76, rel-4_77, HEAD |
| Changes since 1.2: | +16 -0 lines |
| Log Message: | *** empty log message *** |
| # | Content |
|---|---|
| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | open STDIN, "<AIO.xs" |
| 4 | or die "AIO.xs: $!"; |
| 5 | |
| 6 | open STDOUT, ">def0.h" |
| 7 | or die "def0.h: $!"; |
| 8 | |
| 9 | print <<EOF; |
| 10 | /* GENERATED FILE */ |
| 11 | /* use ./gendef0 to regenerate this file */ |
| 12 | EOF |
| 13 | |
| 14 | while (<>) { |
| 15 | if (/\/\*GENDEF0_SYSCALL\((.*),(.*)\)\*\//) { |
| 16 | my ($syscall, $linux) = ($1, $2); |
| 17 | print <<EOF; |
| 18 | #if HAVE_SYSCALL |
| 19 | # if __linux__ && !defined(SYS_$syscall) |
| 20 | # define SYS_$syscall $linux |
| 21 | # endif |
| 22 | #else |
| 23 | # undef SYS_$syscall |
| 24 | #endif |
| 25 | #ifndef SYS_$syscall |
| 26 | # define SYS_$syscall -1 |
| 27 | #endif |
| 28 | EOF |
| 29 | } |
| 30 | |
| 31 | if (/^\s*const_iv\s*\((\S+)\)\s*$/ || /^\s*const_niv\s*\([^,]+,\s*(\S+)\)\s*$/) { |
| 32 | print "#ifndef $1\n", |
| 33 | "#define $1 0\n", |
| 34 | "#endif\n"; |
| 35 | } |
| 36 | } |