diff --git a/src/bin/eolian/legacy_generator.c b/src/bin/eolian/legacy_generator.c index 52303a525a..8e0efbdc04 100644 --- a/src/bin/eolian/legacy_generator.c +++ b/src/bin/eolian/legacy_generator.c @@ -89,7 +89,7 @@ _eapi_decl_func_generate(const Eolian_Class *class, const Eolian_Function *funci { if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) eina_strbuf_append(fparam, "const "); - eina_strbuf_append(fparam, "Eo *obj"); + eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname); } sprintf (tmpstr, "comment%s", suffix); const char *desc = eolian_function_description_get(funcid, tmpstr); @@ -263,8 +263,10 @@ _eapi_func_generate(const Eolian_Class *class, const Eolian_Function *funcid, Eo { if (ftype == EOLIAN_PROP_GET || eolian_function_object_is_const(funcid)) eina_strbuf_append(fparam, "const "); - eina_strbuf_append(fparam, "Eo *obj"); - eina_strbuf_replace_all(fbody, "@#eo_obj", "(Eo *)obj"); + eina_strbuf_append_printf(fparam, "%s *obj", class_env.full_classname); + char buf[256]; + snprintf(buf, sizeof(buf), "(%s *)obj", class_env.full_classname); + eina_strbuf_replace_all(fbody, "@#eo_obj", buf); } else { diff --git a/src/tests/eolian/data/struct_ref.c b/src/tests/eolian/data/struct_ref.c index 75e3a90ad5..4dfb2d8f71 100644 --- a/src/tests/eolian/data/struct_ref.c +++ b/src/tests/eolian/data/struct_ref.c @@ -1,6 +1,13 @@ #ifndef _TYPES_OUTPUT_C_ #define _TYPES_OUTPUT_C_ +#ifndef _STRUCT_EO_CLASS_TYPE +#define _STRUCT_EO_CLASS_TYPE + +typedef Eo Struct; + +#endif + #ifndef _STRUCT_EO_TYPES #define _STRUCT_EO_TYPES diff --git a/src/tests/eolian/data/typedef_ref.c b/src/tests/eolian/data/typedef_ref.c index d7a8c8665f..2c0c1d353e 100644 --- a/src/tests/eolian/data/typedef_ref.c +++ b/src/tests/eolian/data/typedef_ref.c @@ -1,6 +1,13 @@ #ifndef _TYPES_OUTPUT_C_ #define _TYPES_OUTPUT_C_ +#ifndef _TYPEDEF_EO_CLASS_TYPE +#define _TYPEDEF_EO_CLASS_TYPE + +typedef Eo Typedef; + +#endif + #ifndef _TYPEDEF_EO_TYPES #define _TYPEDEF_EO_TYPES