• Martin Storsjö's avatar
    configure: Check if C++ headers define locale_t · 797efbd4
    Martin Storsjö authored
    In environments that lack a full locale.h implementation, the C++
    headers might implement some fallbacks with the same name
    (on windows, libcxx does this).
    
    In these cases, don't provide the normal fallbacks from vlc_fixups.h
    when compiling in C++ mode, but include the C++ <locale> header instead.
    
    If <locale> provides locale_t, include the header and define
    HAVE_NEWLOCALE (which skips the vlc_fixups.h version of locale_t),
    but keep the vlc_fixups.h fallback for uselocale. (One could
    also add another configure test for whether <locale> provides
    the uselocale function.)
    
    (libcxx doesn't provide any fallback for the uselocale function
    since it isn't easily implemented with the msvcrt _locale_t objects.
    The libcxx fallback locale_t objects are applied via the setlocale
    function, and passed to functions that take a _locale_t parameter.)
    797efbd4
vlc_fixups.h 13.5 KB