This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add PL_sv_zero
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index a2557ec..db1b5b3 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -4766,6 +4766,8 @@ EXTCONST char PL_Yes[]
   INIT("1");
 EXTCONST char PL_No[]
   INIT("");
+EXTCONST char PL_Zero[]
+  INIT("0");
 EXTCONST char PL_hexdigit[]
   INIT("0123456789abcdef0123456789ABCDEF");
 
@@ -5883,6 +5885,20 @@ typedef struct am_table_short AMTS;
 #ifdef USE_LOCALE
 /* These locale things are all subject to change */
 
+#  if      defined(USE_ITHREADS)                \
+      &&   defined(HAS_NEWLOCALE)               \
+      &&   defined(LC_ALL_MASK)                 \
+      &&   defined(HAS_FREELOCALE)              \
+      &&   defined(HAS_USELOCALE)               \
+      && ! defined(NO_THREAD_SAFE_USELOCALE)
+
+    /* The code is written for simplicity to assume that any platform advanced
+     * enough to have the Posix 2008 locale functions has LC_ALL.  The test
+     * above makes sure that assumption is valid */
+
+#    define USE_THREAD_SAFE_LOCALE
+#  endif
+
 #   define LOCALE_INIT   MUTEX_INIT(&PL_locale_mutex)
 
 #   ifdef USE_THREAD_SAFE_LOCALE
@@ -5897,7 +5913,6 @@ typedef struct am_table_short AMTS;
                             PL_C_locale_obj = (locale_t) NULL;              \
                         }                                                   \
                      } STMT_END
-    }
 #   else
 #       define LOCALE_TERM   MUTEX_DESTROY(&PL_locale_mutex)
 #   endif
@@ -5952,7 +5967,7 @@ typedef struct am_table_short AMTS;
 #           define _CHECK_AND_WARN_PROBLEMATIC_LOCALE                         \
                 STMT_START {                                                  \
                     if (UNLIKELY(PL_warn_locale)) {                           \
-                        _warn_problematic_locale();                           \
+                        Perl__warn_problematic_locale();                      \
                     }                                                         \
                 }  STMT_END
 #       else
@@ -5988,20 +6003,6 @@ typedef struct am_table_short AMTS;
 
 #   endif   /* PERL_CORE or PERL_IN_XSUB_RE */
 
-#if      defined(USE_ITHREADS)              \
-    &&   defined(HAS_NEWLOCALE)             \
-    &&   defined(LC_ALL_MASK)               \
-    &&   defined(HAS_FREELOCALE)            \
-    &&   defined(HAS_USELOCALE)             \
-    && ! defined(NO_THREAD_SAFE_USELOCALE)
-
-    /* The code is written for simplicity to assume that any platform advanced
-     * enough to have the Posix 2008 locale functions has LC_ALL.  The test
-     * above makes sure that assumption is valid */
-
-#   define USE_THREAD_SAFE_LOCALE
-#endif
-
 #else   /* No locale usage */
 #   define LOCALE_INIT
 #   define LOCALE_TERM
@@ -6136,7 +6137,7 @@ expression, but with an empty argument list, like this:
 #define STORE_LC_NUMERIC_SET_TO_NEEDED()                                    \
     if (IN_LC(LC_NUMERIC)) {                                                \
         if (_NOT_IN_NUMERIC_UNDERLYING) {                                   \
-            set_numeric_local();                                            \
+            Perl_set_numeric_local(aTHX);                                   \
             _restore_LC_NUMERIC_function = &Perl_set_numeric_standard;      \
         }                                                                   \
     }                                                                       \
@@ -6155,31 +6156,32 @@ expression, but with an empty argument list, like this:
 /* The next two macros set unconditionally.  These should be rarely used, and
  * only after being sure that this is what is needed */
 #define SET_NUMERIC_STANDARD()                                              \
-       STMT_START { if (_NOT_IN_NUMERIC_STANDARD) set_numeric_standard();  \
-                                                                 } STMT_END
+       STMT_START { if (_NOT_IN_NUMERIC_STANDARD)                          \
+                                          Perl_set_numeric_standard(aTHX);  \
+                   } STMT_END
 
 #define SET_NUMERIC_UNDERLYING()                                            \
        STMT_START { if (_NOT_IN_NUMERIC_UNDERLYING)                        \
-                                            set_numeric_local(); } STMT_END
+                                Perl_set_numeric_local(aTHX); } STMT_END
 
 /* The rest of these LC_NUMERIC macros toggle to one or the other state, with
  * the RESTORE_foo ones called to switch back, but only if need be */
 #define STORE_LC_NUMERIC_UNDERLYING_SET_STANDARD()                          \
        bool _was_local = _NOT_IN_NUMERIC_STANDARD;                         \
-       if (_was_local) set_numeric_standard();
+       if (_was_local) Perl_set_numeric_standard(aTHX);
 
 /* Doesn't change to underlying locale unless within the scope of some form of
  * 'use locale'.  This is the usual desired behavior. */
 #define STORE_LC_NUMERIC_STANDARD_SET_UNDERLYING()                          \
        bool _was_standard = _NOT_IN_NUMERIC_UNDERLYING                     \
                             && IN_LC(LC_NUMERIC);                           \
-       if (_was_standard) set_numeric_local();
+       if (_was_standard) Perl_set_numeric_local(aTHX);
 
 /* Rarely, we want to change to the underlying locale even outside of 'use
  * locale'.  This is principally in the POSIX:: functions */
 #define STORE_LC_NUMERIC_FORCE_TO_UNDERLYING()                              \
     if (_NOT_IN_NUMERIC_UNDERLYING) {                                       \
-        set_numeric_local();                                                \
+        Perl_set_numeric_local(aTHX);                                       \
         _restore_LC_NUMERIC_function = &Perl_set_numeric_standard;          \
     }
 
@@ -6199,7 +6201,7 @@ expression, but with an empty argument list, like this:
             } STMT_END
 
 #define RESTORE_LC_NUMERIC_UNDERLYING()                     \
-       if (_was_local) set_numeric_local();
+       if (_was_local) Perl_set_numeric_local(aTHX);
 
 #define RESTORE_LC_NUMERIC_STANDARD()                       \
     if (_restore_LC_NUMERIC_function) {                     \