aom: Forward-port stack alignment change from libvpx.

From fce89190affd8645f60e21e861e2edf54a0ac1e5 Mon Sep 17 00:00:00 2001
From: Peter Kasting <[EMAIL REDACTED]>
Date: Mon, 12 Feb 2024 09:43:45 -0800
Subject: [PATCH] Forward-port stack alignment change from libvpx.

This landed as
https://chromium-review.googlesource.com/c/webm/libvpx/+/364140 in what
seems to be the time between when the libvpx sources were copied to form
the initial libaom sources, and when the libaom sources actually landed.

AFAICT, it's harmless and correct? The goal here is to align the two
repos' thread headers with the hopes of unifying.

Bug: none
Change-Id: Ia1d9badf938642419fe6fa8d98e2ac0efd412073
---
 aom_util/aom_thread.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/aom_util/aom_thread.h b/aom_util/aom_thread.h
index ec2ea43491..7ebd2ccc72 100644
--- a/aom_util/aom_thread.h
+++ b/aom_util/aom_thread.h
@@ -58,7 +58,12 @@ typedef CONDITION_VARIABLE pthread_cond_t;
 // simplistic pthread emulation layer
 
 // _beginthreadex requires __stdcall
+#if defined(__GNUC__) && \
+    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+#define THREADFN __attribute__((force_align_arg_pointer)) unsigned int __stdcall
+#else
 #define THREADFN unsigned int __stdcall
+#endif
 #define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
 
 static INLINE int pthread_attr_init(pthread_attr_t *attr) {