Skip to content

Commit

Permalink
Merge pull request #16118 from neikeq/i-dont-know-what-to-write-here-…
Browse files Browse the repository at this point in the history
…anymore

Mono: Fix build errors with tools=no and target=release
  • Loading branch information
akien-mga authored Jan 27, 2018
2 parents 947abe9 + 0c3bbca commit dcacf36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/mono/csharp_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ String CSharpLanguage::_get_indentation() const {

Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() {

#ifdef DEBUG_ENABLED
// Printing an error here will result in endless recursion, so we must be careful

if (!gdmono->is_runtime_initialized() || !GDMono::get_singleton()->get_api_assembly() || !GDMonoUtils::mono_cache.corlib_cache_updated)
Expand All @@ -463,8 +464,12 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info()
si = stack_trace_get_info(stack_trace);

return si;
#else
return Vector<StackInfo>();
#endif
}

#ifdef DEBUG_ENABLED
Vector<ScriptLanguage::StackInfo> CSharpLanguage::stack_trace_get_info(MonoObject *p_stack_trace) {

// Printing an error here could result in endless recursion, so we must be careful
Expand Down Expand Up @@ -514,6 +519,7 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::stack_trace_get_info(MonoObjec

return si;
}
#endif

void CSharpLanguage::frame() {

Expand Down Expand Up @@ -1546,6 +1552,7 @@ bool CSharpScript::_update_exports() {
return false;
}

#ifdef TOOLS_ENABLED
bool CSharpScript::_get_member_export(GDMonoClass *p_class, GDMonoClassMember *p_member, PropertyInfo &r_prop_info, bool &r_exported) {

StringName name = p_member->get_name();
Expand Down Expand Up @@ -1616,6 +1623,7 @@ bool CSharpScript::_get_member_export(GDMonoClass *p_class, GDMonoClassMember *p

return true;
}
#endif

void CSharpScript::_clear() {

Expand Down
4 changes: 4 additions & 0 deletions modules/mono/csharp_script.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class CSharpScript : public Script {
void _clear();

bool _update_exports();
#ifdef TOOLS_ENABLED
bool _get_member_export(GDMonoClass *p_class, GDMonoClassMember *p_member, PropertyInfo &r_prop_info, bool &r_exported);
#endif

CSharpInstance *_create_instance(const Variant **p_args, int p_argcount, Object *p_owner, bool p_isref, Variant::CallError &r_error);
Variant _new(const Variant **p_args, int p_argcount, Variant::CallError &r_error);
Expand Down Expand Up @@ -335,7 +337,9 @@ class CSharpLanguage : public ScriptLanguage {
virtual void *alloc_instance_binding_data(Object *p_object);
virtual void free_instance_binding_data(void *p_data);

#ifdef DEBUG_ENABLED
Vector<StackInfo> stack_trace_get_info(MonoObject *p_stack_trace);
#endif

CSharpLanguage();
~CSharpLanguage();
Expand Down

0 comments on commit dcacf36

Please sign in to comment.