84 lines
2.6 KiB
Diff
84 lines
2.6 KiB
Diff
|
diff -up gobject-introspection-1.30.0/girepository/girffi.c.enum-fixes gobject-introspection-1.30.0/girepository/girffi.c
|
||
|
--- gobject-introspection-1.30.0/girepository/girffi.c.enum-fixes 2011-11-29 12:30:04.759106057 -0600
|
||
|
+++ gobject-introspection-1.30.0/girepository/girffi.c 2011-11-29 11:06:26.540248521 -0600
|
||
|
@@ -30,16 +30,10 @@
|
||
|
#include "girepository.h"
|
||
|
#include "girepository-private.h"
|
||
|
|
||
|
-/**
|
||
|
- * gi_type_tag_get_ffi_type:
|
||
|
- * @tag: A #GITypeTag
|
||
|
- * @is_pointer: Whether or not this is a pointer type
|
||
|
- *
|
||
|
- * Returns: A #ffi_type corresponding to the platform default C ABI for @tag and @is_pointer.
|
||
|
- */
|
||
|
-ffi_type *
|
||
|
-gi_type_tag_get_ffi_type (GITypeTag tag,
|
||
|
- gboolean is_pointer)
|
||
|
+static ffi_type *
|
||
|
+gi_type_tag_get_ffi_type_internal (GITypeInfo *info,
|
||
|
+ GITypeTag tag,
|
||
|
+ gboolean is_pointer)
|
||
|
{
|
||
|
switch (tag)
|
||
|
{
|
||
|
@@ -77,12 +71,27 @@ gi_type_tag_get_ffi_type (GITypeTag ta
|
||
|
case GI_TYPE_TAG_UTF8:
|
||
|
case GI_TYPE_TAG_FILENAME:
|
||
|
case GI_TYPE_TAG_ARRAY:
|
||
|
- case GI_TYPE_TAG_INTERFACE:
|
||
|
case GI_TYPE_TAG_GLIST:
|
||
|
case GI_TYPE_TAG_GSLIST:
|
||
|
case GI_TYPE_TAG_GHASH:
|
||
|
case GI_TYPE_TAG_ERROR:
|
||
|
return &ffi_type_pointer;
|
||
|
+ case GI_TYPE_TAG_INTERFACE:
|
||
|
+ {
|
||
|
+ /* This is for compat, but is broken! */
|
||
|
+ if (info == NULL)
|
||
|
+ return &ffi_type_pointer;
|
||
|
+
|
||
|
+ GIBaseInfo *interface = g_type_info_get_interface (info);
|
||
|
+ switch (g_base_info_get_type (interface))
|
||
|
+ {
|
||
|
+ case GI_INFO_TYPE_ENUM:
|
||
|
+ case GI_INFO_TYPE_FLAGS:
|
||
|
+ return &ffi_type_sint32;
|
||
|
+ default:
|
||
|
+ return &ffi_type_pointer;
|
||
|
+ }
|
||
|
+ }
|
||
|
case GI_TYPE_TAG_VOID:
|
||
|
if (is_pointer)
|
||
|
return &ffi_type_pointer;
|
||
|
@@ -96,6 +105,20 @@ gi_type_tag_get_ffi_type (GITypeTag ta
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
+ * gi_type_tag_get_ffi_type:
|
||
|
+ * @tag: A #GITypeTag
|
||
|
+ * @is_pointer: Whether or not this is a pointer type
|
||
|
+ *
|
||
|
+ * Returns: A #ffi_type corresponding to the platform default C ABI for @tag and @is_pointer.
|
||
|
+ */
|
||
|
+ffi_type *
|
||
|
+gi_type_tag_get_ffi_type (GITypeTag tag,
|
||
|
+ gboolean is_pointer)
|
||
|
+{
|
||
|
+ return gi_type_tag_get_ffi_type_internal (NULL, tag, is_pointer);
|
||
|
+}
|
||
|
+
|
||
|
+/**
|
||
|
* g_type_info_get_ffi_type:
|
||
|
* @info: A #GITypeInfo
|
||
|
*
|
||
|
@@ -104,7 +127,7 @@ gi_type_tag_get_ffi_type (GITypeTag ta
|
||
|
ffi_type *
|
||
|
g_type_info_get_ffi_type (GITypeInfo *info)
|
||
|
{
|
||
|
- return gi_type_tag_get_ffi_type (g_type_info_get_tag (info), g_type_info_is_pointer (info));
|
||
|
+ return gi_type_tag_get_ffi_type_internal (info, g_type_info_get_tag (info), g_type_info_is_pointer (info));
|
||
|
}
|
||
|
|
||
|
/**
|