summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index db6643bf6ba..06bec36200c 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -214,6 +214,8 @@ Slice::Gen::generate(const UnitPtr& unit)
_dllExport += " ";
}
+ printDefInt64Macro(H);
+
ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport);
unit->visit(&proxyDeclVisitor);
@@ -263,6 +265,8 @@ Slice::Gen::generate(const UnitPtr& unit)
ImplVisitor implVisitor(implH, implC, _dllExport);
unit->visit(&implVisitor);
}
+
+ printUndefInt64Macro(H);
}
Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport) :
@@ -935,11 +939,7 @@ Slice::Gen::TypesVisitor::visitConstDef(const ConstDefPtr& p)
H << nl << "const " << typeToString(p->type()) << " " << p->name() << " = ";
BuiltinPtr bp = BuiltinPtr::dynamicCast(p->type());
- if(bp && bp->kind() != Builtin::KindString)
- {
- H << p->value();
- }
- else
+ if(bp && bp->kind() == Builtin::KindString)
{
//
// Expand strings into the basic source character set. We can't use isalpha() and the like
@@ -981,6 +981,14 @@ Slice::Gen::TypesVisitor::visitConstDef(const ConstDefPtr& p)
H << "\""; // Closing "
}
+ else if(bp && bp->kind() == Builtin::KindLong)
+ {
+ H << "INT64LITERAL(" << p->value() << ")";
+ }
+ else
+ {
+ H << p->value();
+ }
H << ";";
}