This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add :not_characters parameter to 'use locale'
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index a373511..fe1eaec 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -4824,6 +4824,7 @@ typedef enum {
 #define HINT_STRICT_REFS       0x00000002 /* strict pragma */
 #define HINT_LOCALE            0x00000004 /* locale pragma */
 #define HINT_BYTES             0x00000008 /* bytes pragma */
+#define HINT_LOCALE_NOT_CHARS  0x00000010 /* locale ':not_characters' pragma */
                                /* Note: 20,40,80 used for NATIVE_HINTS */
                                /* currently defined by vms/vmsish.h */
 
@@ -5264,11 +5265,23 @@ typedef struct am_table_short AMTS;
 #define SET_NUMERIC_LOCAL() \
        set_numeric_local();
 
+/* Returns non-zero If the plain locale pragma without a parameter is in effect
+ */
 #define IN_LOCALE_RUNTIME      (CopHINTS_get(PL_curcop) & HINT_LOCALE)
+
+/* Returns non-zero If either form of the locale pragma is in effect */
+#define IN_SOME_LOCALE_FORM_RUNTIME   \
+               (CopHINTS_get(PL_curcop) & (HINT_LOCALE|HINT_LOCALE_NOT_CHARS))
+
 #define IN_LOCALE_COMPILETIME  (PL_hints & HINT_LOCALE)
+#define IN_SOME_LOCALE_FORM_COMPILETIME \
+                           (PL_hints & (HINT_LOCALE|HINT_LOCALE_NOT_CHARS))
 
 #define IN_LOCALE \
        (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
+#define IN_SOME_LOCALE_FORM \
+       (IN_PERL_COMPILETIME ? IN_SOME_LOCALE_FORM_COMPILETIME \
+                            : IN_SOME_LOCALE_FORM_RUNTIME)
 
 #define STORE_NUMERIC_LOCAL_SET_STANDARD() \
        bool was_local = PL_numeric_local && IN_LOCALE; \