Skip to content

Commit

Permalink
Add DEBUG_SETLOCALE_INCONSISTENCIES
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent fc10308 commit f7f860b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions perl.h
Expand Up @@ -1425,6 +1425,18 @@ typedef enum {
/* end of makedef.pl logic duplication
* ========================================================================= */

#ifdef DEBUG_SETLOCALE_INCONSISTENCIES
# if ! defined(DEBUGGING) || defined(USE_POSIX_2008) || ! defined(USE_LOCALE_CTYPE)
# undef DEBUG_SETLOCALE_INCONSISTENCIES
# endif
#endif
#ifdef DEBUG_SETLOCALE_INCONSISTENCIES
# define PERL_ASSERT_CATEGORY_EQ_CTYPE(cat) \
assert(strEQ(setlocale(cat, NULL), setlocale(LC_CTYPE, NULL)))
#else
# define PERL_ASSERT_CATEGORY_EQ_CTYPE(cat) NOOP
#endif

#ifdef PERL_CORE

/* These typedefs are used in locale.c only (and documented there), but defined
Expand Down Expand Up @@ -7484,6 +7496,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
#ifdef LC_TIME_LOCK
# define STRFTIME_LOCK /* Needs one exclusive lock */ \
STMT_START { LC_CTYPE_LOCK; LC_TIME_LOCK; ENV_READ_LOCK; \
PERL_ASSERT_CATEGORY_EQ_CTYPE(LC_TIME); \
} STMT_END
# define STRFTIME_UNLOCK \
STMT_START { ENV_READ_UNLOCK; LC_TIME_UNLOCK; LC_CTYPE_UNLOCK; \
Expand Down

0 comments on commit f7f860b

Please sign in to comment.