[CRT] Add vadefs macros for arm64 (#4123)

CORE-17621 CORE-17518
This commit is contained in:
Justin Miller 2021-12-09 06:16:20 -08:00 committed by GitHub
parent cd991e3d63
commit 6dfc13e411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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