summaryrefslogtreecommitdiff
path: root/src/trans/codegen_c.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-01 21:20:01 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-01 21:20:01 +0800
commitb5a559c4b80ceb697212c98badea2e0192710e0c (patch)
tree6cb05f6dc89c54c2eff4b0cd57d0b66dfb13d1da /src/trans/codegen_c.cpp
parentfa59ba5317f83d7bbb38aa7668360fa7e2bad7fc (diff)
downloadmrust-b5a559c4b80ceb697212c98badea2e0192710e0c.tar.gz
Trans - Tweaks to forward declarations
Diffstat (limited to 'src/trans/codegen_c.cpp')
-rw-r--r--src/trans/codegen_c.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp
index b73b4d37..ef64ebcd 100644
--- a/src/trans/codegen_c.cpp
+++ b/src/trans/codegen_c.cpp
@@ -77,7 +77,7 @@ namespace {
{
TRACE_FUNCTION_F(ty);
TU_IFLET( ::HIR::TypeRef::Data, ty.m_data, Tuple, te,
- // TODO: Pre-define tuple name
+ 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,
// TODO: Pre-define function type name
@@ -116,7 +116,7 @@ namespace {
TU_IFLET( ::HIR::TypeRef::Data, ty.m_data, Tuple, te,
if( te.size() > 0 )
{
- m_of << "typedef struct {\n";
+ m_of << "typedef struct "; emit_ctype(ty); m_of << " {\n";
for(unsigned int i = 0; i < te.size(); i++)
{
m_of << "\t";