mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-24 09:07:41 +08: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 #6585.
This commit is contained in:
parent
9b763581cf
commit
215df7eec6
@ -925,10 +925,18 @@ class pcre2_matcher_t : public string_matcher_t {
|
|||||||
#if PCRE2_CODE_UNIT_WIDTH == 8
|
#if PCRE2_CODE_UNIT_WIDTH == 8
|
||||||
uint8_t match_index_msb;
|
uint8_t match_index_msb;
|
||||||
uint8_t match_index_lsb;
|
uint8_t match_index_lsb;
|
||||||
|
#if CHAR_BIT == PCRE2_CODE_UNIT_WIDTH
|
||||||
char name[];
|
char name[];
|
||||||
|
#else
|
||||||
|
char8_t name[];
|
||||||
|
#endif
|
||||||
#elif PCRE2_CODE_UNIT_WIDTH == 16
|
#elif PCRE2_CODE_UNIT_WIDTH == 16
|
||||||
uint16_t match_index;
|
uint16_t match_index;
|
||||||
|
#if WCHAR_T_BITS == PCRE2_CODE_UNIT_WIDTH
|
||||||
|
wchar_t name[];
|
||||||
|
#else
|
||||||
char16_t name[];
|
char16_t name[];
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
uint32_t match_index;
|
uint32_t match_index;
|
||||||
#if WCHAR_T_BITS == PCRE2_CODE_UNIT_WIDTH
|
#if WCHAR_T_BITS == PCRE2_CODE_UNIT_WIDTH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user