remove clocale test

clocale is part of C++11.

In practical terms, gcc's libstdc++ comes with its own locale defines
when the libc does not have them.

Also reworked to be dependent on !ANDROID.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-09-29 14:51:17 -07:00
parent 65d257675f
commit 980e32f69c
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
2 changed files with 1 additions and 5 deletions

View File

@ -147,8 +147,6 @@ add_global_arguments(common_cppflags, language: 'cpp')
enable_daemon = not is_windows and not is_android and get_option('daemon') enable_daemon = not is_windows and not is_android and get_option('daemon')
conf.set('ENABLE_DAEMON', enable_daemon) conf.set('ENABLE_DAEMON', enable_daemon)
conf.set('HAVE_CLOCALE', compiler.has_header('clocale'))
conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r')) conf.set('HAVE_GETPWNAM_R', compiler.has_function('getpwnam_r'))
conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r')) conf.set('HAVE_GETPWUID_R', compiler.has_function('getpwuid_r'))
conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups')) conf.set('HAVE_INITGROUPS', compiler.has_function('initgroups'))

View File

@ -111,7 +111,7 @@
#include <climits> #include <climits>
#ifdef HAVE_CLOCALE #ifndef ANDROID
#include <clocale> #include <clocale>
#endif #endif
@ -358,11 +358,9 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
#endif #endif
#ifndef ANDROID #ifndef ANDROID
#ifdef HAVE_CLOCALE
/* initialize locale */ /* initialize locale */
std::setlocale(LC_CTYPE,""); std::setlocale(LC_CTYPE,"");
std::setlocale(LC_COLLATE, ""); std::setlocale(LC_COLLATE, "");
#endif
#endif #endif
const ScopeIcuInit icu_init; const ScopeIcuInit icu_init;