eolian: fix incorrect function prototypes in legacy headers

C functions that take no arguments need to have void in the arg
list. Otherwise, it would mean taking any number of arguments.
This commit is contained in:
Daniel Kolesa 2017-03-31 17:49:38 +02:00
parent 19d4f31839
commit 7b20950aaf
1 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,10 @@ _gen_func(const Eolian_Function *fid, Eolian_Function_Type ftype,
if (flagbuf)
eina_strbuf_append_char(flagbuf, ')');
/* zero-arg funcs in C need void for arguments */
if (eina_strbuf_string_get(buf)[eina_strbuf_length_get(buf) - 1] == '(')
eina_strbuf_append(buf, "void");
eina_strbuf_append(buf, ")");
if (eolian_function_return_is_warn_unused(fid, ftype))
{