This avoids having libmingwex refer to the dllimported data symbol from msvcrt.dll, easing linking to ucrtbase.dll which doesn't have it exported as a data symbol.
___mb_cur_max_func didn't exist in msvcrt.dll until Windows XP, while __mb_cur_max existed already in Windows 2000. Since we require at least XP now, we can simplify this by using ___mb_cur_max_func directly. This allows simplifying the ucrtbase compatibility wrapper. Signed-off-by: Martin Storsjö <mar...@martin.st> --- Updated the commit message to clarify why the code might have been as it was, and why it is ok to change. --- mingw-w64-headers/crt/ctype.h | 2 +- mingw-w64-headers/crt/stdlib.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-headers/crt/ctype.h b/mingw-w64-headers/crt/ctype.h index 9d42896..1508836 100644 --- a/mingw-w64-headers/crt/ctype.h +++ b/mingw-w64-headers/crt/ctype.h @@ -203,7 +203,7 @@ int __cdecl iswblank(wint_t _C); #define __mb_cur_max (* __MINGW_IMP_SYMBOL(__mb_cur_max)) #endif #endif -#define ___mb_cur_max_func() (__mb_cur_max) +_CRTIMP int __cdecl ___mb_cur_max_func(void); #endif #define __chvalidchk(a,b) (__PCTYPE_FUNC[(a)] & (b)) diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h index 00c7855..c2990cc 100644 --- a/mingw-w64-headers/crt/stdlib.h +++ b/mingw-w64-headers/crt/stdlib.h @@ -115,7 +115,7 @@ extern "C" { #define __mb_cur_max (* __MINGW_IMP_SYMBOL(__mb_cur_max)) #endif #endif -#define ___mb_cur_max_func() (__mb_cur_max) +_CRTIMP int __cdecl ___mb_cur_max_func(void); #endif #define __max(a,b) (((a) > (b)) ? (a) : (b)) -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public