diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-11 22:15:40 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-11 22:15:40 +0800 |
commit | 1ad1cf8233c1432daf3202507d1a0552bd02ccab (patch) | |
tree | 2294567efebfc294ec8c5ee99a067f23779b1956 | |
parent | 9b5309136a190ea74c3206eccc87eff4dc7ab1cc (diff) | |
download | mrust-1ad1cf8233c1432daf3202507d1a0552bd02ccab.tar.gz |
Codegen C - Don't emit forward decls of tUNIT
-rw-r--r-- | src/trans/codegen_c.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index dff9c111..bfb8619b 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -181,7 +181,10 @@ namespace { { TRACE_FUNCTION_F(ty); TU_IFLET( ::HIR::TypeRef::Data, ty.m_data, Tuple, te, - m_of << "typedef struct "; emit_ctype(ty); m_of << " "; emit_ctype(ty); m_of << ";\n"; + if( te.size() > 0 ) + { + m_of << "typedef struct "; emit_ctype(ty); m_of << " "; emit_ctype(ty); m_of << ";\n"; + } ) else TU_IFLET( ::HIR::TypeRef::Data, ty.m_data, Function, te, emit_type_fn(ty); m_of << "\n"; |