]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compilation warnings on Android
authorPo Lu <luangruo@yahoo.com>
Sat, 1 Feb 2025 12:59:24 +0000 (20:59 +0800)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:13:40 +0000 (12:13 +0100)
* src/alloc.c (pointer_align): Only define if
!USE_ALIGNED_ALLOC.

(cherry picked from commit 532ff6e29df87b9fdc84c56cddd9c587c5895e48)

src/alloc.c

index 40a59854a878df578f9ff52fba0f7b180c13f452..c39459e1f2e8b26226c249d64b76387665032999 100644 (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.  */