[vlc-devel] [PATCH] configure: Add a new test for <locale.h>

Kamil Rytarowski n54 at gmx.com
Mon Feb 26 07:24:21 CET 2018


On 25.02.2018 20:44, Rémi Denis-Courmont wrote:
> Le perjantaina 23. helmikuuta 2018, 10.25.14 EET Kamil Rytarowski a écrit :
>> Don't simply assume that the uselocale() check is equivalent for the check
>> of detecting the <locale.h> POSIX header.
>>
>> The NetBSD system ships with POSIX <locale.h>, however without the
>> uselocale() function.
>>
>> Include <locale.h> in src/config/file.c for systems with detected <locale.h>
>> instead of just for systems with detected uselocale() and not being
>> __APPLE__. ---
>>  configure.ac      | 3 +++
>>  src/config/file.c | 2 +-
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 225bcae987..cb282b4732 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -852,6 +852,9 @@ AC_CHECK_HEADERS([features.h getopt.h linux/dccp.h
>> linux/magic.h mntent.h sys/ev dnl  MacOS
>>  AC_CHECK_HEADERS([xlocale.h])
>>
>> +dnl  POSIX
>> +AC_CHECK_HEADERS([locale.h])
>> +
>>  dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
>> AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl
>> ` (fix VIM syntax highlight AC_CHECK_TYPE(ssize_t,, [
>> diff --git a/src/config/file.c b/src/config/file.c
>> index 6270a6bc9d..16b9d55377 100644
>> --- a/src/config/file.c
>> +++ b/src/config/file.c
>> @@ -32,7 +32,7 @@
>>  #include <sys/stat.h>
>>  #ifdef __APPLE__
>>  #   include <xlocale.h>
>> -#elif defined(HAVE_USELOCALE)
>> +#elif defined(HAVE_LOCALE_H)
>>  #include <locale.h>
>>  #endif
>>  #include <unistd.h>
> 
> Frankly, it makes zero sense to support newlocale() and not support 
> uselocale() at the same time. And with that said, it is far simpler to replace 
> HAVE_USELOCALE with HAVE_NEWLOCALE.
> 
> Checking for locale.h does not make much sense since it is assumed to be exist 
> in many places already.
> 

I'm fine with this approach. I will be back to this file once I will
upstream more of my local patches and push the build forwards.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 850 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180226/ef49f10d/attachment.sig>


More information about the vlc-devel mailing list