https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6dfc13e411795976c94fa…
commit 6dfc13e411795976c94fafdeeff1acff604cb605
Author: Justin Miller <justinmiller100(a)gmail.com>
AuthorDate: Thu Dec 9 06:16:20 2021 -0800
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Dec 9 17:16:20 2021 +0300
[CRT] Add vadefs macros for arm64 (#4123)
CORE-17621 CORE-17518
---
sdk/include/crt/vadefs.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sdk/include/crt/vadefs.h b/sdk/include/crt/vadefs.h
index b714f59ab7b..17ab6f61b59 100644
--- a/sdk/include/crt/vadefs.h
+++ b/sdk/include/crt/vadefs.h
@@ -70,6 +70,15 @@ extern "C" {
#define _crt_va_arg(ap,t) (*(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) -
_SLOTSIZEOF(t)))
#define _crt_va_end(ap) ( ap = (va_list)0 )
#define __va_copy(d,s) ((void)((d) = (s)))
+#elif defined(_M_ARM64)
+extern void __cdecl __va_start(va_list*, ...);
+#define __crt_va_start(ap,v) ((void)(__va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v),
__alignof(v), _ADDRESSOF(v))))
+#define __crt_va_arg(ap, t) \
+ ((sizeof(t) > (2 * sizeof(__int64))) \
+ ? **(t**)((ap += sizeof(__int64)) - sizeof(__int64)) \
+ : *(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
+#define __crt_va_end(ap) ((void)(ap = (va_list)0))
+#define __va_copy(d,s) ((void)((d) = (s)))
#else //if defined(_M_IA64) || defined(_M_CEE)
#error Please implement me
#endif