Skip to content

Commit

Permalink
locale.c: Win32: Don't check folds validity
Browse files Browse the repository at this point in the history
This code will check, when warnings are on, that the libc functions
return valid values.  But Windows platforms will always fail because
they have multiple divergences from the Posix standard.  The macros that
implement the case changing/folding in handy.h take extra steps to bring
Windows code more into alignment with Posix.  Those are too complicated
to easily duplicate the logic here.  The result of these checks is
looked at by our test suite, which has long, without anyone noticing,
skipped portions on Windows, even though handy.h should correct for
this.  So simply, don't do the checking under Windows, and find out what
handy.h has failed to fully correct for.
  • Loading branch information
khwilliamson committed May 9, 2021
1 parent dcb84cb commit adc22e3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion locale.c
Expand Up @@ -1459,10 +1459,20 @@ S_new_ctype(pTHX_ const char *newctype)
* POSIX::setlocale() */

unsigned int i;
bool maybe_utf8_turkic = FALSE;

#ifdef WIN32

/* Windows will have lots of problems because it doesn't adhere to the
* POSIX standard. Macros in handy.h try to compensate */
bool check_for_problems = FALSE;

#else

/* Don't check for problems if we are suppressing the warnings */
bool check_for_problems = ckWARN_d(WARN_LOCALE) || UNLIKELY(DEBUG_L_TEST);
bool maybe_utf8_turkic = FALSE;

#endif

PERL_ARGS_ASSERT_NEW_CTYPE;

Expand Down

0 comments on commit adc22e3

Please sign in to comment.