eo: eo_class_get() supports objects and classes

This commit is contained in:
Jérémy Zurcher 2013-09-27 00:13:31 +02:00 committed by Tom Hacohen
parent 8855024e16
commit c4b40aae0d
1 changed files with 6 additions and 0 deletions

View File

@ -512,6 +512,12 @@ eo_class_do_super_internal(const char *file, int line, const Eo *klass_id,
EAPI const Eo *
eo_class_get(const Eo *obj_id)
{
if (_eo_is_a_class(obj_id))
{
EO_CLASS_POINTER_RETURN_VAL(obj_id, _klass, NULL);
return obj_id;
}
EO_OBJ_POINTER_RETURN_VAL(obj_id, obj, NULL);
if (obj->klass)