引入一个折中的不定参方案

This commit is contained in:
pointer-to-bios 2024-04-04 22:48:38 +08:00
parent 37ee2ca85d
commit 341ca618de
1 changed files with 15 additions and 1 deletions

View File

@ -10,4 +10,18 @@
void pointer_to_string(u64 addr, char *dest);
typedef struct __va_args
{
usize length;
void *args[0];
} va_args;
#define va_args_gen(result, length) \
void *__reserved__[length]; \
va_args __va_args__; \
result = &__va_args__;
#define va_args_set(vaargs, index, val) \
vaargs->args[index] = &val;
#endif