eolian: generate underscored structs as well as correct opaque struct typedefs
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 13 May 2015 10:14:49 +0000 (11:14 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 13 May 2015 10:14:49 +0000 (11:14 +0100)
src/bin/eolian/types_generator.c
src/tests/eolian/data/struct_ref.c

index abe926b6b49b6304091a20cd2ff97652b2aae9d1..b9d561a79e11214942cec58b6d9ab65b51b5fd02 100644 (file)
@@ -87,11 +87,11 @@ _type_generate(const Eolian_Type *tp, Eina_Bool in_typedef, Eina_Bool full)
               char *name = _concat_name(tp);
               if ((in_typedef && name) || tp_type == EOLIAN_TYPE_STRUCT_OPAQUE || !full)
                 {
-                   eina_strbuf_append_printf(buf, "struct %s", name);
+                   eina_strbuf_append_printf(buf, "typedef struct _%s %s", name, name);
                    free(name);
                    break;
                 }
-              eina_strbuf_append_printf(buf, "typedef struct\n{\n");
+              eina_strbuf_append_printf(buf, "typedef struct _%s\n{\n", name);
               Eina_Iterator *members = eolian_type_struct_fields_get(tp);
               EINA_ITERATOR_FOREACH(members, member)
                 {
index 117a584a5296fd053b1d70282470280bddb87132..8598ec235897be1ead8dd23c5050d6a5ee9d010f 100644 (file)
@@ -11,18 +11,18 @@ typedef Eo Struct;
 #ifndef _STRUCT_EO_TYPES
 #define _STRUCT_EO_TYPES
 
-typedef struct
+typedef struct _Named
 {
   int field;
   const char *something;
 } Named;
 
-typedef struct
+typedef struct _Another
 {
   Named field;
 } Another;
 
-struct Opaque;
+typedef struct _Opaque Opaque;
 
 
 #endif