summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-03 13:39:15 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-03 13:39:15 -0400
commita68704403ab88657d4abaad25f673bf40267931a (patch)
treec4cd8708ed841a112a8a643c78842c5eb3ab2bd9 /include
parent06623f2b33fc9975e52d431eaa45526899ff1b3c (diff)
TObject, TMainTask: Make object names extern, and declare them in
`TObject.cpp` This is to make it match the order in the original binary.
Diffstat (limited to 'include')
-rw-r--r--include/pso/TMainTask.h2
-rw-r--r--include/pso/TObject.h5
-rw-r--r--include/pso/macros.h5
3 files changed, 7 insertions, 5 deletions
diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h
index b719e94..6a4944d 100644
--- a/include/pso/TMainTask.h
+++ b/include/pso/TMainTask.h
@@ -5,8 +5,6 @@
#include "pso/macros.h"
#include "pso/TObject.h"
-OBJECT_NAME(TMainTask)
-
class TMainTask : public TObject {
public:
u32 task_flags;
diff --git a/include/pso/TObject.h b/include/pso/TObject.h
index bf23b56..1594d33 100644
--- a/include/pso/TObject.h
+++ b/include/pso/TObject.h
@@ -5,8 +5,9 @@
#include "pso/macros.h"
#include <global_types.h>
-
-OBJECT_NAME(TObject)
+#define o(name) extern const char *name##_name;
+OBJECT_NAMES
+#undef o
extern TMainTask main_task;
extern TObject global_obj1;
diff --git a/include/pso/macros.h b/include/pso/macros.h
index 1a75d53..b98028f 100644
--- a/include/pso/macros.h
+++ b/include/pso/macros.h
@@ -1,7 +1,10 @@
#ifndef MACROS_H
#define MACROS_H
-#define OBJECT_NAME(name) static const char *name##_name = #name;
+#define OBJECT_NAME(name) const char *name##_name = #name;
+#define OBJECT_NAMES \
+ o(TObject) \
+ o(TMainTask)
#define FOREACH_NODE(type, first, varname) for (type *varname = (type *)(first); varname != NULL; varname = (type *)(varname->next))
#define FOREACH_NODE_NODECL(type, first, varname) for (varname = (type *)(first); varname != NULL; varname = (type *)(varname->next))