summaryrefslogtreecommitdiff
path: root/include/libc/stdarg.h
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2025-01-07 09:19:18 +0000
committerGitHub <noreply@github.com>2025-01-07 04:19:18 -0500
commita3c3c38fead604508fef7626fa8ae494d67df52c (patch)
tree75d3994254bee297e473bfbc57f82adcbbd27177 /include/libc/stdarg.h
parent727b61aaf88cd2dc3da3acac05dc9e7bff9b8b5b (diff)
[iQue] Match libultra/libc (#2407)
Diffstat (limited to 'include/libc/stdarg.h')
-rw-r--r--include/libc/stdarg.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/libc/stdarg.h b/include/libc/stdarg.h
index ec57a0c84..7c7d2800e 100644
--- a/include/libc/stdarg.h
+++ b/include/libc/stdarg.h
@@ -66,11 +66,12 @@ typedef char * __gnuc_va_list;
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement. */
-#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \
- ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
- : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
- + __va_rounded_size(__type))))[-1]
+#define va_arg(__AP, __type) \
+ ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \
+ ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
+ : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
+ + __va_rounded_size (__type))), \
+ *(__type *) (void *) (__AP - __va_rounded_size (__type)))
typedef __gnuc_va_list va_list;