22 lines
780 B
C
22 lines
780 B
C
// Minimal freestanding variadic argument support for nt-lite target builds.
|
|
|
|
#pragma once
|
|
|
|
#ifdef _MSC_VER
|
|
#define va_list __crt_va_list
|
|
#define va_start __crt_va_start
|
|
#define va_arg __crt_va_arg
|
|
#define va_end __crt_va_end
|
|
#define va_copy(destination, source) ((destination) = (source))
|
|
typedef char* __crt_va_list;
|
|
#define __crt_va_start(ap, x) ((ap) = (char*)(&(x)) + ((sizeof(x) + 7u) & ~7u))
|
|
#define __crt_va_arg(ap, t) (*(t*)(((ap) += 8u) - 8u))
|
|
#define __crt_va_end(ap) ((ap) = (char*)0)
|
|
#else
|
|
#define va_list __builtin_va_list
|
|
#define va_start(ap, last) __builtin_va_start(ap, last)
|
|
#define va_arg(ap, type) __builtin_va_arg(ap, type)
|
|
#define va_end(ap) __builtin_va_end(ap)
|
|
#define va_copy(destination, source) __builtin_va_copy(destination, source)
|
|
#endif
|