Skip to content

Commit e1cc84f

Browse files
committed
Add mono_custom_attrs_get_attrs API that was missed during rebase onto master. 1449b13
1 parent c735825 commit e1cc84f

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

mono/metadata/unity-utils.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,26 @@ mono_unity_g_free(void *ptr)
142142
g_free (ptr);
143143
}
144144

145+
146+
MONO_API MonoClass*
147+
mono_custom_attrs_get_attrs (MonoCustomAttrInfo *ainfo, gpointer *iter)
148+
{
149+
int index = -1;
150+
if (!iter)
151+
return NULL;
152+
if (!*iter)
153+
{
154+
*iter = 1;
155+
return ainfo->attrs[0].ctor->klass;
156+
}
157+
158+
index = GPOINTER_TO_INT (*iter);
159+
if (index >= ainfo->num_attrs)
160+
return NULL;
161+
*iter = GINT_TO_POINTER (index + 1);
162+
return ainfo->attrs[index].ctor->klass;
163+
}
164+
145165
MONO_API gboolean
146166
mono_class_is_inflated (MonoClass *klass)
147167
{

mono/metadata/unity-utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ MONO_API MonoClass* mono_unity_class_get(MonoImage* image, guint32 type_token);
163163
MONO_API gpointer mono_unity_alloc(gsize size);
164164
MONO_API void mono_unity_g_free (void *ptr);
165165

166-
// hack, FIXME jon
166+
MONO_API MonoClass* mono_custom_attrs_get_attrs (MonoCustomAttrInfo *ainfo, gpointer *iter);
167+
167168
typedef size_t (*RemapPathFunction)(const char* path, char* buffer, size_t buffer_len);
168169
MONO_API void mono_unity_register_path_remapper (RemapPathFunction func);
169170
gboolean

0 commit comments

Comments
 (0)