eo: eo_class_get() supports objects and classes
authorJérémy Zurcher <jeremy@asynk.ch>
Thu, 26 Sep 2013 22:13:31 +0000 (00:13 +0200)
committerTom Hacohen <tom@stosb.com>
Fri, 27 Sep 2013 13:01:46 +0000 (14:01 +0100)
src/lib/eo/eo.c

index f6b9d3507e34084ac0481d911542aed91f4fa3b1..371da282f614b0b0cc6b273311e72d2f58306381 100644 (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)