Force return type of main to int in CppEmitter.
This commit is contained in:
parent
e46ddfcd80
commit
ea94de076d
|
@ -321,7 +321,11 @@ bool CppEmitter::emit(Module const& module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppEmitter::emit(FunctionPrototype const& proto) {
|
bool CppEmitter::emit(FunctionPrototype const& proto) {
|
||||||
|
if (proto.getName().getValue() == "main") {
|
||||||
|
stream << "int ";
|
||||||
|
} else {
|
||||||
stream << proto.getType() << ' ';
|
stream << proto.getType() << ' ';
|
||||||
|
}
|
||||||
GUARDED(proto.getName().emit(this));
|
GUARDED(proto.getName().emit(this));
|
||||||
stream << "(";
|
stream << "(";
|
||||||
emitFunctionParams(proto.getArgs());
|
emitFunctionParams(proto.getArgs());
|
||||||
|
|
Reference in New Issue
Block a user