From: Po Lu Date: Wed, 2 Aug 2023 00:10:59 +0000 (+0800) Subject: Merge remote-tracking branch 'origin/master' into feature/android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f7052599877de9e855d743c68c88cc5729456f1f;p=emacs.git Merge remote-tracking branch 'origin/master' into feature/android --- f7052599877de9e855d743c68c88cc5729456f1f diff --cc src/image.c index 8a8f18754ac,cb9725892d1..06fc44b5abd --- a/src/image.c +++ b/src/image.c @@@ -655,19 -646,9 +685,20 @@@ image_create_bitmap_from_data (struct f return id; } -#if defined HAVE_HAIKU || defined HAVE_NS || defined HAVE_PGTK -static char *slurp_file (int, ptrdiff_t *); -static Lisp_Object image_find_image_fd (Lisp_Object, int *); +#if defined HAVE_ANDROID && !defined ANDROID_STUBIFY +#include "android.h" + +/* This abstraction allows directly loading images from assets without + copying them to a file descriptor first. */ +typedef struct android_fd_or_asset image_fd; +#else /* !defined HAVE_ANDROID || defined ANDROID_STUBIFY */ +typedef int image_fd; +#endif /* defined HAVE_ANDROID && !defined ANDROID_STUBIFY */ + - #if defined HAVE_HAIKU || defined HAVE_NS || defined HAVE_ANDROID ++#if defined HAVE_HAIKU || defined HAVE_NS || defined HAVE_PGTK \ ++ || defined HAVE_ANDROID +static char *slurp_file (image_fd, ptrdiff_t *); +static Lisp_Object image_find_image_fd (Lisp_Object, image_fd *); static bool xbm_read_bitmap_data (struct frame *, char *, char *, int *, int *, char **, bool); #endif