Fix compilation warnings on Android

* src/alloc.c (pointer_align): Only define if
!USE_ALIGNED_ALLOC.
This commit is contained in:
Po Lu 2025-02-01 20:59:24 +08:00
parent d58fe6619f
commit 532ff6e29d

View file

@ -501,14 +501,6 @@ Lisp_Object const *staticvec[NSTATICS];
int staticidx;
#ifndef HAVE_ALIGNED_ALLOC
static void *
pointer_align (void *ptr, int alignment)
{
return (void *) ROUNDUP ((uintptr_t) ptr, alignment);
}
#endif
/* Extract the pointer hidden within O. */
static ATTRIBUTE_NO_SANITIZE_UNDEFINED void *
@ -1095,6 +1087,16 @@ struct ablocks
/* The list of free ablock. */
static struct ablock *free_ablock;
#if !USE_ALIGNED_ALLOC
static void *
pointer_align (void *ptr, int alignment)
{
return (void *) ROUNDUP ((uintptr_t) ptr, alignment);
}
#endif /* !USE_ALIGNED_ALLOC */
/* Allocate an aligned block of nbytes.
Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be
smaller or equal to BLOCK_BYTES. */