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; } <>;
In reply to Converting C #define to 'use constant' statements by rpc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |