Fix compilation errors

This commit is contained in:
Florian Rival
2018-09-09 20:04:10 +01:00
parent 026d48b86b
commit 2f0d01e577
4 changed files with 8 additions and 6 deletions

View File

@@ -393,14 +393,14 @@ class GD_CORE_API EventsCodeGenerator {
*
* Example: "gdjs.something."
*/
virtual gd::String GetCodeNamespaceAccessor();
virtual gd::String GetCodeNamespaceAccessor() { return ""; };
/**
* \brief Get the namespace to be used to store code generated objects/values/functions.
*
* Example: "gdjs.something"
*/
virtual gd::String GetCodeNamespace();
virtual gd::String GetCodeNamespace() { return ""; };
protected:
/**
* \brief Generate the code for a single parameter.

View File

@@ -63,7 +63,9 @@ class Extension : public ExtensionBase {
gd::String functionName =
instruction.GetParameter(0).GetPlainString();
if (!codeGenerator.HasProjectAndLayout()) return "/*Function generation not supported without layout*/";
if (!codeGenerator.HasProjectAndLayout()) {
return gd::String("/*Function generation not supported without layout*/");
}
const gd::Project& project = codeGenerator.GetProject();
const gd::Layout& layout = codeGenerator.GetLayout();

View File

@@ -194,7 +194,7 @@ gd::String EventsCodeGenerator::GenerateBehaviorCondition(
// Verify that object has behavior.
vector<gd::String> behaviors =
gd::GetBehaviorsOfObject(GetGlobalObjectAndGroups(), GetObjectAndGroups(), objectName);
gd::GetBehaviorsOfObject(GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), objectName);
if (find(behaviors.begin(), behaviors.end(), behaviorName) ==
behaviors.end()) {
cout << "Bad behavior requested" << endl;
@@ -326,7 +326,7 @@ gd::String EventsCodeGenerator::GenerateBehaviorAction(
// Verify that object has behavior.
vector<gd::String> behaviors =
gd::GetBehaviorsOfObject(GetGlobalObjectAndGroups(), GetObjectAndGroups(), objectName);
gd::GetBehaviorsOfObject(GetGlobalObjectsAndGroups(), GetObjectsAndGroups(), objectName);
if (find(behaviors.begin(), behaviors.end(), behaviorName) ==
behaviors.end()) {
cout << "Bad behavior requested for an action" << endl;

View File

@@ -264,7 +264,7 @@ CommonInstructionsExtension::CommonInstructionsExtension() {
gd::EventsCodeGenerator& codeGenerator,
gd::EventsCodeGenerationContext& context) {
if (!codeGenerator.HasProjectAndLayout()) {
return "/*Link not supported when generating code without a layout*/"
return gd::String("/*Link not supported when generating code without a layout*/");
};
gd::LinkEvent& event = dynamic_cast<gd::LinkEvent&>(event_);