From da739f32830ef19b3400cbdf1ba18f5342abe7f0 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 26 Feb 2023 19:12:55 -0400 Subject: pso/macros: Add `EXTERN_OBJECT_NAME` macro --- context.h | 2 ++ include/pso/macros.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/context.h b/context.h index 1e0952b..e68f5ce 100644 --- a/context.h +++ b/context.h @@ -31,6 +31,8 @@ typedef long ptrdiff_t; #define ATTRIBUTE_ALIGN(num) __attribute__((aligned(num))) // pso/macros.h +#define EXTERN_OBJECT_NAME(name) extern const char *name##_name; + #define OBJECT_NAME(name) const char *name##_name = #name; #define OBJECT_NAMES \ o(TObject) \ diff --git a/include/pso/macros.h b/include/pso/macros.h index a341b7f..e93e2de 100644 --- a/include/pso/macros.h +++ b/include/pso/macros.h @@ -1,6 +1,8 @@ #ifndef MACROS_H #define MACROS_H +#define EXTERN_OBJECT_NAME(name) extern const char *name##_name; + #define OBJECT_NAME(name) const char *name##_name = #name; #define OBJECT_NAMES \ o(TObject) \ -- cgit v1.2.3-13-gbd6f