struct threadlocaleinfostruct was introduced in msvcr70.dll and in each msvcrt version it was slightly updated. Fix this structure in corecrt.h header file to match the binary ABI of the msvcrt version which is used to compile current object file according to __MSVCRT_VERSION__ and _UCRT macros.
UCRT renamed few members and for source file compatibility use anonymous union for accessing both the old msvcrt name and new UCRT name. --- mingw-w64-headers/crt/corecrt.h | 35 +++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/mingw-w64-headers/crt/corecrt.h b/mingw-w64-headers/crt/corecrt.h index abb720885cec..25165aeb0729 100644 --- a/mingw-w64-headers/crt/corecrt.h +++ b/mingw-w64-headers/crt/corecrt.h @@ -451,33 +451,60 @@ typedef struct tagLC_ID { #define _THREADLOCALEINFO typedef struct threadlocaleinfostruct { #ifdef _UCRT - const unsigned short *_locale_pctype; - int _locale_mb_cur_max; - unsigned int _locale_lc_codepage; -#else + union { const unsigned short *_locale_pctype; const unsigned short *pctype; }; /* pctype alias is for compatiblity with msvcrt field name */ + union { int _locale_mb_cur_max; int mb_cur_max; }; /* mb_cur_max alias is for compatiblity with msvcrt field name */ + union { unsigned int _locale_lc_codepage; int lc_codepage; }; /* lc_codepage alias is for compatibility with msvcrt field name */ +#endif int refcount; +#ifndef _UCRT unsigned int lc_codepage; +#endif unsigned int lc_collate_cp; +#if __MSVCRT_VERSION__ >= 0xB00 || defined(_UCRT) + unsigned int lc_time_cp; +#else unsigned long lc_handle[6]; +#if __MSVCRT_VERSION__ >= 0x800 LC_ID lc_id[6]; +#endif +#endif +#ifdef _UCRT + int lc_clike; +#endif +#if __MSVCRT_VERSION__ >= 0x800 || defined(_UCRT) struct { char *locale; wchar_t *wlocale; int *refcount; int *wrefcount; } lc_category[6]; +#endif +#ifndef _UCRT int lc_clike; int mb_cur_max; +#endif int *lconv_intl_refcount; int *lconv_num_refcount; int *lconv_mon_refcount; struct lconv *lconv; +#if __MSVCRT_VERSION__ < 0x800 && !defined(_UCRT) + struct lconv *lconv_intl; +#endif int *ctype1_refcount; unsigned short *ctype1; +#ifndef _UCRT const unsigned short *pctype; +#endif +#if __MSVCRT_VERSION__ >= 0x800 || defined(_UCRT) const unsigned char *pclmap; const unsigned char *pcumap; +#endif struct __lc_time_data *lc_time_curr; +#if __MSVCRT_VERSION__ < 0x800 && !defined(_UCRT) + struct __lc_time_data *lc_time_intl; +#endif +#if __MSVCRT_VERSION__ >= 0xB00 || defined(_UCRT) + wchar_t* locale_name[6]; #endif } threadlocinfo; #endif /* _THREADLOCALEINFO */ -- 2.20.1 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public