From 7796369fb7978a1556e7a9c1a2c9d59704b1a2e5 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 5 Feb 2023 03:38:07 +0800 Subject: [PATCH] Update obj.h --- src/obj.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/obj.h b/src/obj.h index f780bd2e..98f2ac33 100644 --- a/src/obj.h +++ b/src/obj.h @@ -93,6 +93,7 @@ struct Py_ : PyObject { virtual void* value() override { return &_valueT; } }; -#define UNION_GET(T, obj) (((Py_*)((obj).get()))->_valueT) +//#define UNION_GET(T, obj) (((Py_*)((obj).get()))->_valueT) +#define UNION_GET(T, obj) (*static_cast((obj)->value())) #define UNION_NAME(obj) UNION_GET(_Str, (obj)->attribs[__name__]) #define UNION_TP_NAME(obj) UNION_GET(_Str, (obj)->type->attribs[__name__]) \ No newline at end of file