summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-03-31 17:49:38 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-03-31 17:49:41 +0200
commit7b20950aaf31f1247789e96e4db0f362bd4d5d7d (patch)
tree94fd0b57cc83dea3ee9fa29959b9c6a3fd663e52
parent19d4f3183915e5b3fe6c974019f445ab8976f918 (diff)
downloadefl-7b20950aaf31f1247789e96e4db0f362bd4d5d7d.tar.gz
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.
-rw-r--r--src/bin/eolian/headers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index 853b8672e8..2b88f6cd63 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -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))
{