Merge remote-tracking branches 'neheb/defa', 'neheb/auto' and 'neheb/clocale' into master
This commit is contained in:
commit
362f391b76
@ -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'))
|
||||||
|
@ -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;
|
||||||
|
@ -46,7 +46,7 @@ size_t
|
|||||||
decoder_read_much(DecoderClient *client, InputStream &is,
|
decoder_read_much(DecoderClient *client, InputStream &is,
|
||||||
void *_buffer, size_t size) noexcept
|
void *_buffer, size_t size) noexcept
|
||||||
{
|
{
|
||||||
uint8_t *buffer = (uint8_t *)_buffer;
|
auto buffer = (uint8_t *)_buffer;
|
||||||
|
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ bool
|
|||||||
decoder_read_full(DecoderClient *client, InputStream &is,
|
decoder_read_full(DecoderClient *client, InputStream &is,
|
||||||
void *_buffer, size_t size) noexcept
|
void *_buffer, size_t size) noexcept
|
||||||
{
|
{
|
||||||
auto *buffer = (uint8_t *)_buffer;
|
auto buffer = (uint8_t *)_buffer;
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
size_t nbytes = decoder_read(client, is, buffer, size);
|
size_t nbytes = decoder_read(client, is, buffer, size);
|
||||||
|
@ -291,7 +291,7 @@ FileDescriptor::GetSize() const noexcept
|
|||||||
void
|
void
|
||||||
FileDescriptor::FullRead(void *_buffer, size_t length)
|
FileDescriptor::FullRead(void *_buffer, size_t length)
|
||||||
{
|
{
|
||||||
auto *buffer = (uint8_t *)_buffer;
|
auto buffer = (uint8_t *)_buffer;
|
||||||
|
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
ssize_t nbytes = Read(buffer, length);
|
ssize_t nbytes = Read(buffer, length);
|
||||||
@ -309,7 +309,7 @@ FileDescriptor::FullRead(void *_buffer, size_t length)
|
|||||||
void
|
void
|
||||||
FileDescriptor::FullWrite(const void *_buffer, size_t length)
|
FileDescriptor::FullWrite(const void *_buffer, size_t length)
|
||||||
{
|
{
|
||||||
const uint8_t *buffer = (const uint8_t *)_buffer;
|
auto buffer = (const uint8_t *)_buffer;
|
||||||
|
|
||||||
while (length > 0) {
|
while (length > 0) {
|
||||||
ssize_t nbytes = Write(buffer, length);
|
ssize_t nbytes = Write(buffer, length);
|
||||||
|
Loading…
Reference in New Issue
Block a user