summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-06 18:02:50 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-06 18:02:50 +0200
commitcb2b6d666cf21ae575d09339a5aedf1dc180ca6e (patch)
tree8953209cf709aacf1e807f341cb787a5f69c5e0b /src/bin/eolian
parent3b540fc9f93e63cd2d1d687ee1108542627628fd (diff)
eolian_gen: make errors compile/work
This is not thread safe, but I don't see any better way out for now. We'd probably need a different error API for that. Ref T6890
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/types.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index e79b73b..7fe1a85 100644
--- a/src/bin/eolian/types.c
+++ b/src/bin/eolian/types.c
@@ -234,7 +234,7 @@ _err_generate(const Eolian_State *state, const Eolian_Error *err)
234 if (!buf) buf = eina_strbuf_new(); 234 if (!buf) buf = eina_strbuf_new();
235 else eina_strbuf_append_char(buf, '\n'); 235 else eina_strbuf_append_char(buf, '\n');
236 236
237 eina_strbuf_prepend_printf(buf, "EWAPI extern Eina_Error %s_get(void);\n\n", fn); 237 eina_strbuf_prepend_printf(buf, "EWAPI Eina_Error %s_get(void);\n\n", fn);
238 238
239 char *ufn = strdup(fn); 239 char *ufn = strdup(fn);
240 eina_str_toupper(&ufn); 240 eina_str_toupper(&ufn);
@@ -332,11 +332,13 @@ _source_gen_error(Eina_Strbuf *buf, const Eolian_Error *err)
332 *p = '_'; 332 *p = '_';
333 eina_str_tolower(&fn); 333 eina_str_tolower(&fn);
334 334
335 eina_strbuf_append_printf(buf, "EWAPI %s_get(void)\n{\n", fn); 335 eina_strbuf_append_printf(buf, "EWAPI Eina_Error %s_get(void)\n{\n", fn);
336 free(fn); 336 free(fn);
337 337
338 const char *msg = eolian_error_message_get(err); 338 const char *msg = eolian_error_message_get(err);
339 eina_strbuf_append(buf, " static Eina_Error err = eina_error_msg_static_register(\""); 339 eina_strbuf_append(buf, " static Eina_Error err = EINA_ERROR_NO_ERROR;\n");
340 eina_strbuf_append(buf, " if (err == EINA_ERROR_NO_ERROR)\n");
341 eina_strbuf_append(buf, " err = eina_error_msg_static_register(\"");
340 for (const char *p = msg; *p; ++p) 342 for (const char *p = msg; *p; ++p)
341 switch (*p) 343 switch (*p)
342 { 344 {