summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-01-29 17:04:36 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-01-29 17:07:11 -0400
commiteed7594cc942129127559f4bf976570f730b8b86 (patch)
tree51fad5c58eb2ab3c640ed84a90540c821920d1aa
parent5503179cb82fe478fbb5595b98ff6a042e083db7 (diff)
pso: add `macros.h`
-rw-r--r--include/pso/TObject.h13
-rw-r--r--include/pso/macros.h6
-rw-r--r--src/pso/TObject.cpp4
3 files changed, 12 insertions, 11 deletions
diff --git a/include/pso/TObject.h b/include/pso/TObject.h
index 74d7d1c..b5f7dee 100644
--- a/include/pso/TObject.h
+++ b/include/pso/TObject.h
@@ -1,13 +1,11 @@
-#pragma once
-#include "types.h"
+#ifndef TOBJECT_H
+#define TOBJECT_H
-#define OBJECT_NAMES \
- o(TObject)
+#include "pso/macros.h"
+#include "types.h"
-/*#define CREATE_CTOR(type, parent_type) \
- const char *type##_name = #type; \
- type::type(parent_type *parent)*/
+OBJECT_NAME(TObject)
class TObject {
public:
@@ -112,3 +110,4 @@ private:
return this->flags & flags;
};
};
+#endif
diff --git a/include/pso/macros.h b/include/pso/macros.h
new file mode 100644
index 0000000..c449b6f
--- /dev/null
+++ b/include/pso/macros.h
@@ -0,0 +1,6 @@
+#ifndef MACROS_H
+#define MACROS_H
+
+#define OBJECT_NAME(name) static const char *name##_name = #name;
+
+#endif
diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp
index 20d942d..aacd389 100644
--- a/src/pso/TObject.cpp
+++ b/src/pso/TObject.cpp
@@ -1,10 +1,6 @@
#include "pso/TObject.h"
#define MATCHING
-#define o(name) const char *name##_name = #name;
-OBJECT_NAMES
-#undef o
-
void debug_print(const char *fmt) {
}