Skip to content

Commit

Permalink
Redefine the POSIX.xs locale macros using prev commit
Browse files Browse the repository at this point in the history
This commit uses the new macro introduced in the previous commit to
define the internal locale mutex macros in POSIX.xs
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent ccff49d commit ab58619
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions perl.h
Expand Up @@ -6761,10 +6761,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
&& ( ! defined(HAS_LOCALECONV_L) \
|| defined(TS_W32_BROKEN_LOCALECONV))) \
|| ( defined(HAS_NL_LANGINFO) \
&& ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L)) \
|| (defined(HAS_MBLEN) && ! defined(HAS_MBRLEN)) \
|| (defined(HAS_MBTOWC) && ! defined(HAS_MBRTOWC)) \
|| (defined(HAS_WCTOMB) && ! defined(HAS_WCRTOMB))))
&& ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L))))

/* The whole expression just above was complemented, so here we have no need
* for thread synchronization, most likely it would be that this isn't a
Expand All @@ -6773,16 +6770,10 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define LOCALECONV_UNLOCK NOOP
# define LOCALE_READ_LOCK NOOP
# define LOCALE_READ_UNLOCK NOOP
# define MBLEN_LOCK NOOP
# define MBLEN_UNLOCK NOOP
# define MBTOWC_LOCK_ NOOP
# define MBTOWC_UNLOCK_ NOOP
# define NL_LANGINFO_LOCK NOOP
# define NL_LANGINFO_UNLOCK NOOP
# define SETLOCALE_LOCK NOOP
# define SETLOCALE_UNLOCK NOOP
# define WCTOMB_LOCK_ NOOP
# define WCTOMB_UNLOCK_ NOOP
#else

/* Here, we will need critical sections in locale handling, because one or
Expand Down Expand Up @@ -6829,18 +6820,6 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define NL_LANGINFO_LOCK LOCALE_LOCK_(0)
# define NL_LANGINFO_UNLOCK LOCALE_UNLOCK_
# endif
# if defined(HAS_MBLEN) && ! defined(HAS_MBRLEN)
# define MBLEN_LOCK_ LOCALE_LOCK_(0)
# define MBLEN_UNLOCK_ LOCALE_UNLOCK_
# endif
# if defined(HAS_MBTOWC) && ! defined(HAS_MBRTOWC)
# define MBTOWC_LOCK_ LOCALE_LOCK_(0)
# define MBTOWC_UNLOCK_ LOCALE_UNLOCK_
# endif
# if defined(HAS_WCTOMB) && ! defined(HAS_WCRTOMB)
# define WCTOMB_LOCK_ LOCALE_LOCK_(0)
# define WCTOMB_UNLOCK_ LOCALE_UNLOCK_
# endif
# if defined(USE_THREAD_SAFE_LOCALE)

/* There may be instance core where we this is invoked yet should do
Expand Down Expand Up @@ -6882,6 +6861,15 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define LC_NUMERIC_UNLOCK NOOP
#endif

# define MBLEN_LOCK_ gwLOCALE_LOCK
# define MBLEN_UNLOCK_ gwLOCALE_UNLOCK

# define MBTOWC_LOCK_ gwLOCALE_LOCK
# define MBTOWC_UNLOCK_ gwLOCALE_UNLOCK

# define WCTOMB_LOCK_ gwLOCALE_LOCK
# define WCTOMB_UNLOCK_ gwLOCALE_UNLOCK

#ifdef USE_LOCALE_NUMERIC

/* These macros are for toggling between the underlying locale (UNDERLYING or
Expand Down

0 comments on commit ab58619

Please sign in to comment.