2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-02-14 21:18:45 +00:00

Extend PCRE2 wchar_t interop support to 16-bit wchar_t impls

Previously, the interop glue for more friendly access to PCRE2's
fixed-size values was only used when char32_t/wchar_t were
interchangeable and PCRE2 was used with a global 32-bit unit width set;
this patch extends the same to char16_t when wchar_t is also 16-bits
(namely on Cygwin) to avoid compilation fpermissive warnings about casts
between types of potentially different sizes.

Reported in .
This commit is contained in:
Mahmoud Al-Qudsi 2021-02-22 13:08:41 -06:00
parent 9b763581cf
commit 215df7eec6

View file

@ -925,10 +925,18 @@ class pcre2_matcher_t : public string_matcher_t {
#if PCRE2_CODE_UNIT_WIDTH == 8
uint8_t match_index_msb;
uint8_t match_index_lsb;
#if CHAR_BIT == PCRE2_CODE_UNIT_WIDTH
char name[];
#else
char8_t name[];
#endif
#elif PCRE2_CODE_UNIT_WIDTH == 16
uint16_t match_index;
#if WCHAR_T_BITS == PCRE2_CODE_UNIT_WIDTH
wchar_t name[];
#else
char16_t name[];
#endif
#else
uint32_t match_index;
#if WCHAR_T_BITS == PCRE2_CODE_UNIT_WIDTH