cat /usr/include/linux/elf.h | perl def2const.pl >>Constants.pm
Much joy. Update: oops, forgot an extra + in there.
#!/usr/bin/perl -w use strict; map { print if s!#\s*define\s+(\S+)\s+([^(?:\s*/\*.*\*/)]+)$!use constant $ +1 => $2;!g; } <>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Converting C #define to 'use constant' statements
by btrott (Parson) on Nov 03, 2000 at 04:42 UTC | |
by tye (Sage) on Nov 03, 2000 at 20:35 UTC | |
by btrott (Parson) on Nov 03, 2000 at 22:43 UTC |