diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-03 22:42:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-03 22:42:10 +0000 |
commit | 2de3dbccea8bcb1d17328cd596713c4aa8443082 (patch) | |
tree | 0427f163d9abc772fad3c27e4e138bea7797dc51 /perl.h | |
parent | 0e053d1e2a5de74963fa7472712777e316fe76f0 (diff) | |
download | perl-2de3dbccea8bcb1d17328cd596713c4aa8443082.tar.gz |
Integrate change #10412 from maintperl; locale is now
per-cop, not per-op; plus retweak the locale.t to always
list the skipped utf8 locales.
p4raw-link: @10412 on //depot/maint-5.6/perl: 71d0b827413df9e881d1c54d2d968823ed50c75b
p4raw-id: //depot/perl@10413
p4raw-edited: from //depot/maint-5.6/perl@10411 'edit in'
t/pragma/locale.t (@8600..)
p4raw-integrated: from //depot/maint-5.6/perl@10411 'merge in'
lib/locale.pm (@5902..) opcode.h pp.sym pp_proto.h (@8620..)
opcode.pl (@8998..) op.h perl.h (@9288..) pp_sys.c (@9524..)
util.c (@9538..) embed.h (@9584..) op.c (@9950..) pp.c
(@10091..) pp_ctl.c (@10100..)
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -2886,7 +2886,8 @@ enum { /* pass one of these to get_vtbl */ #define HINT_PRIVATE_MASK 0x000000ff #define HINT_INTEGER 0x00000001 #define HINT_STRICT_REFS 0x00000002 -/* #define HINT_notused4 0x00000004 */ +#define HINT_LOCALE 0x00000004 +#define HINT_BYTES 0x00000008 #define HINT_BYTES 0x00000008 /* #define HINT_notused10 0x00000010 */ /* Note: 20,40,80 used for NATIVE_HINTS */ @@ -2894,7 +2895,6 @@ enum { /* pass one of these to get_vtbl */ #define HINT_BLOCK_SCOPE 0x00000100 #define HINT_STRICT_SUBS 0x00000200 #define HINT_STRICT_VARS 0x00000400 -#define HINT_LOCALE 0x00000800 #define HINT_NEW_INTEGER 0x00001000 #define HINT_NEW_FLOAT 0x00002000 @@ -3428,16 +3428,23 @@ typedef struct am_table_short AMTS; #define SET_NUMERIC_LOCAL() \ set_numeric_local(); +#define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE) +#define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE) + +#define IN_LOCALE \ + (PL_curcop == &PL_compiling ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME) + #define IS_NUMERIC_RADIX(s) \ - ((PL_hints & HINT_LOCALE) && \ - PL_numeric_radix_sv && memEQ(s, SvPVX(PL_numeric_radix_sv), SvCUR(PL_numeric_radix_sv))) + (PL_numeric_radix_sv \ + && IN_LOCALE \ + && memEQ(s, SvPVX(PL_numeric_radix_sv), SvCUR(PL_numeric_radix_sv))) #define STORE_NUMERIC_LOCAL_SET_STANDARD() \ - bool was_local = (PL_hints & HINT_LOCALE) && PL_numeric_local; \ + bool was_local = PL_numeric_local && IN_LOCALE; \ if (was_local) SET_NUMERIC_STANDARD(); #define STORE_NUMERIC_STANDARD_SET_LOCAL() \ - bool was_standard = (PL_hints & HINT_LOCALE) && PL_numeric_standard; \ + bool was_standard = PL_numeric_standard && IN_LOCALE; \ if (was_standard) SET_NUMERIC_LOCAL(); #define RESTORE_NUMERIC_LOCAL() \ |