diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/make_c_api.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/make_c_api.lua b/tools/make_c_api.lua index cf1cfdc..bf79b26 100644 --- a/tools/make_c_api.lua +++ b/tools/make_c_api.lua @@ -343,7 +343,12 @@ local function write_h_file(filedef, append) -- Forward-declare types defined in this file. for msg in filedef:defs(upb.DEF_MSG) do local msgname = to_cident(msg:full_name()) - append('typedef struct %s { int a; } %s;\n', msgname, msgname) + append('struct %s;\n', msgname) + end + + for msg in filedef:defs(upb.DEF_MSG) do + local msgname = to_cident(msg:full_name()) + append('typedef struct %s %s;\n', msgname, msgname) end -- Forward-declare types not in this file, but used as submessages. |