From: Po Lu Date: Fri, 20 Jan 2023 14:15:53 +0000 (+0800) Subject: Update Android port X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=761c763dd66700f6eb5480cc55228b96d165960d;p=emacs.git Update Android port * src/android.c (android_run_select_thread, android_select) (android_ftruncate): * src/android.h (ftruncate): Fix compilation on Android 16 and up. --- diff --git a/src/android.c b/src/android.c index 47120a6b5f5..3f6e6f4576b 100644 --- a/src/android.c +++ b/src/android.c @@ -274,6 +274,7 @@ android_run_select_thread (void *data) char byte; #else sigset_t signals, waitset; + int sig; #endif #if __ANDROID_API__ < 16 @@ -559,7 +560,9 @@ android_select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timespec *timeout) { int nfds_return; +#if __ANDROID_API__ < 16 static char byte; +#endif pthread_mutex_lock (&event_queue.mutex); @@ -4498,32 +4501,6 @@ android_project_image_nearest (struct android_image *image, -/* System call wrappers for stuff missing in bionic. */ - -#ifndef HAVE_FTRUNCATE - -/* ftruncate wrapper for Android, for systems without ftruncate in the - C library. - - Such systems are always 32 bit systems, since Android 21 and later - all support ftruncate. In addition, ARM and MIPS require registers - used to store long long parameters to be aligned to an even - register pair. */ - -int -android_ftruncate (int fd, off_t length) -{ -#if defined __arm__ || defined __mips__ - return syscall (SYS_ftruncate64, fd, 0, - (unsigned int) (length & 0xffffffff), - (unsigned int) (length >> 32)); -#else - return syscall (SYS_ftruncate64, fd, length); -#endif -} - -#endif - #else /* ANDROID_STUBIFY */ /* X emulation functions for Android. */ diff --git a/src/android.h b/src/android.h index 97818ab4911..52b3412fb0e 100644 --- a/src/android.h +++ b/src/android.h @@ -104,14 +104,6 @@ extern struct android_dir *android_opendir (const char *); extern struct dirent *android_readdir (struct android_dir *); extern void android_closedir (struct android_dir *); -#ifndef HAVE_FTRUNCATE -extern int android_ftruncate (int, off_t); - -/* Replace calls to ftruncate with android_ftruncate when ftruncate is - not defined. */ -#define ftruncate android_ftruncate -#endif - #endif