configure: Check if C++ headers define locale_t
commit797efbd40743251090d4cfa1db176b2317291507
authorMartin Storsjö <martin@martin.st>
Wed, 28 Feb 2018 09:59:55 +0000 (28 11:59 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 28 Feb 2018 20:11:14 +0000 (28 22:11 +0200)
treec0836bf960473cf004143ccab46f5af745700470
parent1151b5c914f6c9bbbdf29fb7f37b506fd195c47a
configure: Check if C++ headers define locale_t

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.)
configure.ac
include/vlc_fixups.h