mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
G_DECLARE_DERIVED_TYPE: allow forward declarations
This allows multiple declarations such as: typedef struct _Foo Foo; as is needed when you have systems with circular referencing. https://bugzilla.gnome.org/show_bug.cgi?id=743596
This commit is contained in:
parent
e8d3f29300
commit
f3c604d273
@ -1464,8 +1464,9 @@ guint g_type_get_type_registration_serial (void);
|
|||||||
**/
|
**/
|
||||||
#define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
|
#define G_DECLARE_DERIVABLE_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
|
||||||
GType module_obj_name##_get_type (void); \
|
GType module_obj_name##_get_type (void); \
|
||||||
typedef struct { ParentName parent_instance; } ModuleObjName; \
|
typedef struct _##ModuleObjName ModuleObjName; \
|
||||||
typedef struct _##ModuleObjName##Class ModuleObjName##Class; \
|
typedef struct _##ModuleObjName##Class ModuleObjName##Class; \
|
||||||
|
struct _##ModuleObjName { ParentName parent_instance; }; \
|
||||||
\
|
\
|
||||||
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
|
||||||
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
|
||||||
|
Loading…
Reference in New Issue
Block a user