diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-12-06 21:01:29 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-12-09 12:08:28 -0700 |
commit | 3a371f2f46da7e5b93de3a1d3cccc9cf99d52c36 (patch) | |
tree | baec5784a1d6f03ffaf678acb6faf3f194dc6c15 /handy.h | |
parent | 1709d539eca0df213028ca1f93c428df8a018f0e (diff) | |
download | perl-3a371f2f46da7e5b93de3a1d3cccc9cf99d52c36.tar.gz |
handy.h: Add an enum typedef
This creates a copy of all the Posix character class numbers and puts
them in an enum. This enum is for internal Perl core use only, and is
used so hopefully compilers can generate better code from future commits
that will make use of it.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -764,6 +764,29 @@ patched there. The file as of this writing is cpan/Devel-PPPort/parts/inc/misc * Latin1 range from the ALPHA bit only in two relatively unimportant * characters: the masculine and feminine ordinal indicators */ +#if defined(PERL_CORE) || defined(PERL_EXT) +/* An enum version of the character class numbers, to help compilers + * optimize */ +typedef enum { + _CC_ENUM_ALNUMC = _CC_ALNUMC, + _CC_ENUM_ALPHA = _CC_ALPHA, + _CC_ENUM_DIGIT = _CC_DIGIT, + _CC_ENUM_GRAPH = _CC_GRAPH, + _CC_ENUM_LOWER = _CC_LOWER, + _CC_ENUM_PRINT = _CC_PRINT, + _CC_ENUM_PUNCT = _CC_PUNCT, + _CC_ENUM_UPPER = _CC_UPPER, + _CC_ENUM_WORDCHAR = _CC_WORDCHAR, + _CC_ENUM_SPACE = _CC_SPACE, + _CC_ENUM_BLANK = _CC_BLANK, + _CC_ENUM_XDIGIT = _CC_XDIGIT, + _CC_ENUM_CNTRL = _CC_CNTRL, + _CC_ENUM_PSXSPC = _CC_PSXSPC, + _CC_ENUM_ASCII = _CC_ASCII, + _CC_ENUM_VERTSPACE = _CC_VERTSPACE +} _char_class_number; +#endif + # ifdef DOINIT EXTCONST U32 PL_charclass[] = { # include "l1_char_class_tab.h" |