From 04622f7d2210cbb8036502afadf5bcdcb0394d28 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 21 Feb 2008 13:27:51 +0000 Subject: first steps in implementing object interfaces (stage work for later dynamic class loading) --- obj-types.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'obj-types.h') diff --git a/obj-types.h b/obj-types.h index d823af47..3046e96f 100644 --- a/obj-types.h +++ b/obj-types.h @@ -296,6 +296,14 @@ typedef struct interface_s { objID_t oID; /* our object ID (later dynamically assigned) */ } interface_t; + +/* the following macro is used to get access to an object (not an instance, + * just the class itself!). It must be called before any of the object's + * methods can be accessed. + */ +#define objUse(obj) \ + obj##QueryInterface(&obj) + /* defines data that must always be present at the very begin of the interface structure */ #define ifBEGIN \ int ifVersion; /* must be set to version requested */ \ @@ -306,7 +314,7 @@ typedef struct interface_s { * the beginning */ #define DEFobjCurrIf(obj) \ - obj##_if_t obj = { .ifVersion = obj##CURR_IF_VERSION }; + static obj##_if_t obj = { .ifVersion = obj##CURR_IF_VERSION }; /* ------------------------------ end object loader system ------------------------------ */ -- cgit v1.2.3