Fixes in order to compile on an Android host (#1823)

* Fixes in order to compile on an Android host

Co-authored-by: Jean-Yves Didier <jeanyves.didier@univ-evry.fr>
This commit is contained in:
jydidier 2022-02-01 01:39:14 +01:00 committed by GitHub
parent e1faa90351
commit 220a00bbdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -7711,7 +7711,11 @@ void runAddonServer(EIS)(string localListenerName, EIS eis) if(is(EIS : EventIoS
void newConnection() {
// on edge triggering, it is important that we get it all
while(true) {
auto size = cast(uint) addr.sizeof;
version(Android) {
auto size = cast(int) addr.sizeof;
} else {
auto size = cast(uint) addr.sizeof;
}
auto ns = accept(sock, cast(sockaddr*) &addr, &size);
if(ns == -1) {
if(errno == EAGAIN || errno == EWOULDBLOCK) {
@ -7845,6 +7849,7 @@ ssize_t write_fd(int fd, void *ptr, size_t nbytes, int sendfd) {
version(OSX) {
//msg.msg_accrights = cast(cattr_t) &sendfd;
//msg.msg_accrightslen = int.sizeof;
} else version(Android) {
} else {
union ControlUnion {
cmsghdr cm;
@ -7886,6 +7891,7 @@ ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) {
version(OSX) {
//msg.msg_accrights = cast(cattr_t) recvfd;
//msg.msg_accrightslen = int.sizeof;
} else version(Android) {
} else {
union ControlUnion {
cmsghdr cm;
@ -7912,6 +7918,7 @@ ssize_t read_fd(int fd, void *ptr, size_t nbytes, int *recvfd) {
version(OSX) {
//if(msg.msg_accrightslen != int.sizeof)
//*recvfd = -1;
} else version(Android) {
} else {
if ( (cmptr = CMSG_FIRSTHDR(&msg)) != null &&
cmptr.cmsg_len == CMSG_LEN(int.sizeof)) {

View file

@ -4,7 +4,7 @@ import std.getopt, std.file, std.path, std.process, std.stdio, std.conv, std.alg
import config, itemdb, monitor, onedrive, selective, sync, util;
import std.net.curl: CurlException;
import core.stdc.signal;
import std.traits;
import std.traits, std.format;
import std.concurrency: receiveTimeout;
static import log;

View file

@ -24,6 +24,7 @@ class Progress
size_t getTerminalWidth() {
size_t column = default_width;
version (CRuntime_Musl) {
} else version(Android) {
} else {
winsize ws;
if(ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) != -1 && ws.ws_col > 0) {