summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKEKW555 <152369890+KEKW555@users.noreply.github.com>2024-01-05 17:57:16 +0530
committerGitHub <noreply@github.com>2024-01-05 17:57:16 +0530
commit743f3f3080fa917130ff63edab33adb348aaf317 (patch)
tree3fcd6b7013e804a2f5efb7c29b187e31f677865b /include
parent6fb8b41a8e003d0a4997740f4178aeb0c3f24ead (diff)
Add Multi return syntatic sugar
Diffstat (limited to 'include')
-rw-r--r--include/global.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index 3cd7c1d0..dcb2a5b8 100644
--- a/include/global.h
+++ b/include/global.h
@@ -119,6 +119,21 @@ typedef struct {
s8 y;
} PACKED Coords8;
+typedef union {
+ s64 DWORD;
+ u64 DWORD_U;
+ struct {
+ s32 LO, HI;
+ } HALF;
+ struct {
+ u32 LO, HI;
+ } HALF_U;
+} SplitDWord;
+
+typedef u64 (*MultiReturnFunctionType)();
+
+#define MULTI_RETURN_FUNCTION_CALL(func, ...) ((SplitDWord)((*(MultiReturnFunctionType)(&func))(__VA_ARGS__)))
+
union SplitWord {
s32 WORD;
u32 WORD_U;