forked from dylex/slack-libpurple
-
Notifications
You must be signed in to change notification settings - Fork 2
/
glibcompat.h
13 lines (11 loc) · 986 Bytes
/
glibcompat.h
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef G_DECLARE_FINAL_TYPE
#define G_DECLARE_FINAL_TYPE(ModuleObjName, module_obj_name, MODULE, OBJ_NAME, ParentName) \
GType module_obj_name##_get_type (void); \
typedef struct _##ModuleObjName ModuleObjName; \
typedef struct { ParentName##Class parent_class; } ModuleObjName##Class; \
\
static inline ModuleObjName * MODULE##_##OBJ_NAME (gpointer ptr) { \
return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
static inline gboolean MODULE##_IS_##OBJ_NAME (gpointer ptr) { \
return G_TYPE_CHECK_INSTANCE_TYPE (ptr, module_obj_name##_get_type ()); }
#endif