summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJulgodis <>2021-09-25 23:39:41 +0200
committerJulgodis <>2021-09-26 03:38:03 +0200
commit2e31b7160b365ec151f2149bd06afa7ec65f4483 (patch)
tree318c57a66a436cee7f185d0b912d7ea8a9514fcf /include
parentd105dd9d803d307a6c2fd9ae6b1af3231ce7d93a (diff)
OK va_list, va_start, va_arg, and va_end
Diffstat (limited to 'include')
-rw-r--r--include/Runtime.PPCEABI.H/__va_arg.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/Runtime.PPCEABI.H/__va_arg.h b/include/Runtime.PPCEABI.H/__va_arg.h
index 3e6751e43f..aed93a5e33 100644
--- a/include/Runtime.PPCEABI.H/__va_arg.h
+++ b/include/Runtime.PPCEABI.H/__va_arg.h
@@ -3,4 +3,32 @@
#include "dolphin/types.h"
+// not sure what the members are. OK when the struct is 12 bytes.
+typedef struct __va_list_struct {
+ u8 data[12];
+};
+
+typedef __va_list_struct __va_list[1];
+
+extern "C" void __va_arg(void*, int);
+
+#if IN_VSCODE_EDITOR
+#define __builtin_va_info(...)
+#define _var_arg_typeof(...)
+#endif
+
+
+// from defined-string in mwcceppc.exe:
+// __builtin_va_info: initialize the __va_list_struct
+// _var_arg_typeof: convert type to integer for __va_arg
+#define __va_start(list, fmt) __builtin_va_info(&list)
+#define __va_arg(list, type) (*((type*)__va_arg(ap, _var_arg_typeof(type))))
+#define va_start __va_start
+#define va_arg __va_arg
+#define va_end __va_end
+#define va_list __va_list
+#define __va_end(list) ((void)0)
+
+#define __va_copy(a, b) (*(a) = *(b))
+
#endif /* __VA_ARG_H */