How to build and use LLVM libc++ on windows(msvc)? (original) (raw)

I guess that things have changed. Looking at the ucrt headers …

    __inline int __CRTDECL _ischartype_l(
        _In_     int       const _C,
        _In_     int       const _Mask,
        _In_opt_ _locale_t const _Locale
        )
    {
        if (!_Locale)
        {
            return _chvalidchk_l(_C, _Mask, 0);
        }

        if (_C >= -1 && _C <= 255)
        {
            return __acrt_get_locale_data_prefix(_Locale)->_locale_pctype[_C] & _Mask;
        }

        if (__acrt_get_locale_data_prefix(_Locale)->_locale_mb_cur_max > 1)
        {
            return _isctype_l(_C, _Mask, _Locale);
        }

        return 0; // >0xFF and SBCS locale
    }

So, the regular path for _ischartype_l will reference this function. _ischartype_l is used through a macro:

    #define _isalpha_l(c, locale)  _ischartype_l(c, _ALPHA, locale)
    #define _isupper_l(c, locale)  _ischartype_l(c, _UPPER, locale)
    #define _islower_l(c, locale)  _ischartype_l(c, _LOWER, locale)
    #define _isdigit_l(c, locale)  _ischartype_l(c, _DIGIT, locale)
    #define _isxdigit_l(c, locale) _ischartype_l(c, _HEX, locale)
    #define _isspace_l(c, locale)  _ischartype_l(c, _SPACE, locale)
    #define _ispunct_l(c, locale)  _ischartype_l(c, _PUNCT, locale)
    #define _isblank_l(c, locale)  (((c) == '\t') ? _BLANK : _ischartype_l(c, _BLANK, locale))
    #define _isalnum_l(c, locale)  _ischartype_l(c, _ALPHA | _DIGIT, locale)
    #define _isprint_l(c, locale)  _ischartype_l(c, _BLANK | _PUNCT | _ALPHA | _DIGIT, locale)
    #define _isgraph_l(c, locale)  _ischartype_l(c, _PUNCT | _ALPHA | _DIGIT, locale)
    #define _iscntrl_l(c, locale)  _ischartype_l(c, _CONTROL, locale)

The definition will need to be provided in all cases, so in this case, I expect that ucrt will have a definition.