q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cb2b6d666cf21ae575d09339a5aedf1dc180ca6e

commit cb2b6d666cf21ae575d09339a5aedf1dc180ca6e
Author: Daniel Kolesa <[email protected]>
Date:   Fri Sep 6 18:02:50 2019 +0200

    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
---
 src/bin/eolian/types.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/bin/eolian/types.c b/src/bin/eolian/types.c
index e79b73b20c..7fe1a85b44 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)
    if (!buf) buf = eina_strbuf_new();
    else eina_strbuf_append_char(buf, '\n');
 
-   eina_strbuf_prepend_printf(buf, "EWAPI extern Eina_Error 
%s_get(void);\n\n", fn);
+   eina_strbuf_prepend_printf(buf, "EWAPI Eina_Error %s_get(void);\n\n", fn);
 
    char *ufn = strdup(fn);
    eina_str_toupper(&ufn);
@@ -332,11 +332,13 @@ _source_gen_error(Eina_Strbuf *buf, const Eolian_Error 
*err)
      *p = '_';
    eina_str_tolower(&fn);
 
-   eina_strbuf_append_printf(buf, "EWAPI %s_get(void)\n{\n", fn);
+   eina_strbuf_append_printf(buf, "EWAPI Eina_Error %s_get(void)\n{\n", fn);
    free(fn);
 
    const char *msg = eolian_error_message_get(err);
-   eina_strbuf_append(buf, "   static Eina_Error err = 
eina_error_msg_static_register(\"");
+   eina_strbuf_append(buf, "   static Eina_Error err = 
EINA_ERROR_NO_ERROR;\n");
+   eina_strbuf_append(buf, "   if (err == EINA_ERROR_NO_ERROR)\n");
+   eina_strbuf_append(buf, "     err = eina_error_msg_static_register(\"");
    for (const char *p = msg; *p; ++p)
      switch (*p)
        {

-- 


Reply via email to