From 9cf9e604c37f07964fe379ff283e117eb73e0562 Mon Sep 17 00:00:00 2001 From: thislooksfun Date: Mon, 25 Oct 2021 20:20:36 -0500 Subject: [PATCH] LibCore: Add REGISTER_ABSTRACT_CORE_OBJECT This behaves identically to REGISTER_CORE_OBJECT, but the resulting ObjectClassRegistration's construct() method will always return null. --- Userland/Libraries/LibCore/Object.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index 16efc5365c..26eaaf8549 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -20,6 +20,13 @@ namespace Core { +#define REGISTER_ABSTRACT_CORE_OBJECT(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return RefPtr(); }); \ + } \ + } + #define REGISTER_CORE_OBJECT(namespace_, class_name) \ namespace Core { \ namespace Registration { \