From 179451ce4508fe2d7e81eb2bda9baed343bc88a7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 1 Feb 2025 20:59:24 +0800 Subject: [PATCH] Fix compilation warnings on Android * src/alloc.c (pointer_align): Only define if !USE_ALIGNED_ALLOC. (cherry picked from commit 532ff6e29df87b9fdc84c56cddd9c587c5895e48) --- src/alloc.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 40a59854a87..c39459e1f2e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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. */ -- 2.39.5