summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-09-05 20:48:15 -0600
committerKarl Williamson <public@khwilliamson.com>2012-09-13 21:14:04 -0600
commitae1d4929d23a3d6949518058aa41cd90a700a4af (patch)
treeb80b6ac50766faa6ce0819feec20715fc42f9fb4 /regen
parentb96a92fb2dbf3acb43641479fc731469e1de9f6c (diff)
downloadperl-ae1d4929d23a3d6949518058aa41cd90a700a4af.tar.gz
regen/regcharclass.pl: Add ability to restrict platforms
This adds the capability to skip definitions if they are for other than a desired platform.
Diffstat (limited to 'regen')
-rwxr-xr-xregen/regcharclass.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl
index 81ac13ce45..c4f5951a3c 100755
--- a/regen/regcharclass.pl
+++ b/regen/regcharclass.pl
@@ -945,6 +945,11 @@ if ( !caller ) {
my ( $op, $title, @txt, @types, %mods );
my $doit= sub {
return unless $op;
+
+ # Skip if to compile on a different platform.
+ return if delete $mods{only_ascii_platform} && ! ASCII_PLATFORM;
+ return if delete $mods{only_ebcdic_platform} && ord 'A' != 193;
+
print $out_fh "/*\n\t$op: $title\n\n";
print $out_fh join "\n", ( map { "\t$_" } @txt ), "*/", "";
my $obj= __PACKAGE__->new( op => $op, title => $title, txt => \@txt );
@@ -1076,6 +1081,10 @@ if ( !caller ) {
# fast The input string is valid UTF-8. No bounds checking is done,
# and the macro can make assumptions that lead to faster
# execution.
+# only_ascii_platform Skip this definition if this program is being run on
+# a non-ASCII platform.
+# only_ebcdic_platform Skip this definition if this program is being run on
+# a non-EBCDIC platform.
# No modifier need be specified; fast is assumed for this case. If both
# 'fast', and 'safe' are specified, two macros will be created for each
# 'type'.