1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-16 12:54:40 +00:00

[iQue] Build some C files with EGCS (#2396)

This commit is contained in:
cadmic 2025-01-02 00:35:22 -08:00 committed by GitHub
parent ffc9f2d4f1
commit 9dafc2f2e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 121 additions and 37 deletions

View file

@ -1,16 +1,16 @@
#ifndef STDARG_H
#define STDARG_H
// When building with GCC, use the official vaarg macros to avoid warnings and possibly bad codegen.
// When building with modern GCC, use the official vaarg macros to avoid warnings and possibly bad codegen.
#ifdef __GNUC__
#if __GNUC__ >= 3
#define va_list __builtin_va_list
#define va_start __builtin_va_start
#define va_arg __builtin_va_arg
#define va_end __builtin_va_end
#else
#elif defined(__sgi) /* IDO */
#ifndef _VA_LIST_
# define _VA_LIST_
@ -52,6 +52,28 @@ typedef char* va_list;
/* No cleanup processing is required for the end of a varargs list: */
#define va_end(__list)
#endif /* __GNUC__ */
#else /* EGCS */
typedef char * __gnuc_va_list;
#define __va_rounded_size(__TYPE) \
(((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
#define va_start(__AP, __LASTARG) \
(__AP = (__gnuc_va_list) __builtin_next_arg (__LASTARG))
#define va_end(__AP) ((void)0)
/* 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]
typedef __gnuc_va_list va_list;
#endif
#endif