e2cfb7a35b6eb9efab97ade0fd6465df9035c9f9
diff --git a/docs/reference/gobject/gobject-sections.txt b/docs/reference/gobject/gobject-sections.txt
index 3326311..b4943da 100644
--- a/docs/reference/gobject/gobject-sections.txt
+++ b/docs/reference/gobject/gobject-sections.txt
@@ -103,6 +103,10 @@ G_DEFINE_ABSTRACT_TYPE
 G_DEFINE_ABSTRACT_TYPE_WITH_CODE
 G_IMPLEMENT_INTERFACE
 G_DEFINE_TYPE_EXTENDED
+G_DEFINE_BOXED_TYPE
+G_DEFINE_BOXED_TYPE_WITH_CODE
+G_DEFINE_POINTER_TYPE
+G_DEFINE_POINTER_TYPE_WITH_CODE
 
 <SUBSECTION Private>
 G_TYPE_FUNDAMENTAL_SHIFT
diff --git a/gobject/gtype.h b/gobject/gtype.h
index 1e9a128..bff4aa5 100644
--- a/gobject/gtype.h
+++ b/gobject/gtype.h
@@ -1402,6 +1402,88 @@ type_name##_get_type (void) \
   return g_define_type_id__volatile;	\
 } /* closes type_name##_get_type() */
 
+/**
+ * G_DEFINE_BOXED_TYPE:
+ * @TypeName: The name of the new type, in Camel case.
+ * @type_name: The name of the new type, in lowercase, with words
+ *  separated by '_'.
+ * @copy_func: the #GBoxedCopyFunc for the new type
+ * @free_func: the #GBoxedFreeFunc for the new type
+ * 
+ * A convenience macro for boxed type implementations, which defines a 
+ * type_name_get_type() function registering the boxed type.
+ *
+ * Since: 2.18
+ */
+#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
+/**
+ * G_DEFINE_BOXED_TYPE_WITH_CODE:
+ * @TypeName: The name of the new type, in Camel case.
+ * @type_name: The name of the new type, in lowercase, with words
+ *  separated by '_'.
+ * @copy_func: the #GBoxedCopyFunc for the new type
+ * @free_func: the #GBoxedFreeFunc for the new type
+ * @_C_: Custom code that gets inserted in the *_get_type() function.
+ * 
+ * A convenience macro for boxed type implementations.
+ * Similar to G_DEFINE_BOXED_TYPE(), but allows to insert custom code into the
+ * type_name_get_type() function, e.g. to register value transformations with
+ * g_value_register_transform_func().
+ *
+ * Since: 2.18
+ */
+#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
+GType \
+type_name##_get_type (void) \
+{ \
+  static volatile gsize g_define_type_id__volatile = 0; \
+  if (g_once_init_enter (&g_define_type_id__volatile))  \
+    { \
+      GType g_define_type_id = \
+        g_boxed_type_register_static (g_intern_static_string (#TypeName), \
+                                      (GBoxedCopyFunc) copy_func, \
+                                      (GBoxedFreeFunc) free_func); \
+      { /* custom code follows */
+
+/**
+ * G_DEFINE_POINTER_TYPE:
+ * @TypeName: The name of the new type, in Camel case.
+ * @type_name: The name of the new type, in lowercase, with words
+ *  separated by '_'.
+ *
+ * A convenience macro for pointer type implementations, which defines a
+ * type_name_get_type() function registering the pointer type.
+ *
+ * Since: 2.18
+ */
+#define G_DEFINE_POINTER_TYPE(TypeName, type_name) G_DEFINE_POINTER_TYPE_WITH_CODE (TypeName, type_name, {})
+/**
+ * G_DEFINE_POINTER_TYPE_WITH_CODE:
+ * @TypeName: The name of the new type, in Camel case.
+ * @type_name: The name of the new type, in lowercase, with words
+ *  separated by '_'.
+ * @_C_: Custom code that gets inserted in the *_get_type() function.
+ *
+ * A convenience macro for pointer type implementations.
+ * Similar to G_DEFINE_POINTER_TYPE(), but allows to insert custom code into the
+ * type_name_get_type() function.
+ *
+ * Since: 2.18
+ */
+#define G_DEFINE_POINTER_TYPE_WITH_CODE(TypeName, type_name, _C_) _G_DEFINE_POINTER_TYPE_BEGIN (TypeName, type_name) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
+
+#define _G_DEFINE_POINTER_TYPE_BEGIN(TypeName, type_name) \
+GType \
+type_name##_get_type (void) \
+{ \
+  static volatile gsize g_define_type_id__volatile = 0; \
+  if (g_once_init_enter (&g_define_type_id__volatile))  \
+    { \
+      GType g_define_type_id = \
+        g_pointer_type_register_static (g_intern_static_string (#TypeName)); \
+      { /* custom code follows */
 
 /* --- protected (for fundamental type implementations) --- */
 GTypePlugin*	 g_type_get_plugin		(GType		     type);
