Skip to content

Commit

Permalink
Bootstrapping: #1318
Browse files Browse the repository at this point in the history
- Changed System.stringAppendList to use stringAppendListExt in OMC (else you get conflicting types)
  - Added testcase meta/DumpTest.mos: It tests Dump.dump Dump.dumpStr Dump.getAstAsCorbaString and DumpGraphviz.dump functionality in OMC
- Bugfix for errorext.cpp (declaring globals as static, so they are not free'd multiple times when we dynamically load functions that also linked against errorext)


git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6363 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 13, 2010
2 parents 78340bf + 97beedd commit c6d51db
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Compiler/System.mo
Expand Up @@ -806,7 +806,7 @@ function stringAppendList
input list<String> listWithStrings;
output String appendedString;

external "C";
external "C" appendedString=stringAppendListExt(listWithStrings);
end stringAppendList;

function refEqual
Expand Down
14 changes: 7 additions & 7 deletions Compiler/runtime/errorext.cpp
Expand Up @@ -49,15 +49,15 @@ struct absyn_info{
int ce;
};
// if error_on is true, message is added, otherwise not.
bool error_on=true;
static bool error_on=true;

#include "ErrorMessage.hpp"
std::string currVariable("");
absyn_info finfo;
bool haveInfo(false);
stack<ErrorMessage*> errorMessageQueue; // Global variable of all error messages.
vector<pair<int,string> > checkPoints; // a checkpoint has a message index no, and a unique identifier
string lastDeletedCheckpoint = "";
static std::string currVariable("");
static absyn_info finfo;
static bool haveInfo(false);
static stack<ErrorMessage*> errorMessageQueue; // Global variable of all error messages.
static vector<pair<int,string> > checkPoints; // a checkpoint has a message index no, and a unique identifier
static string lastDeletedCheckpoint = "";

/* Adds a message without file info. */
void add_message(int errorID,
Expand Down
6 changes: 6 additions & 0 deletions c_runtime/meta_modelica_builtin.cpp
Expand Up @@ -442,6 +442,12 @@ stringAppendList_rettype stringAppendList(modelica_metatype lst)
return res_head;
}

/* OMC declares this const, but we don't always use it in that manner... */
stringAppendListExt_rettype stringAppendListExt(modelica_metatype lst)
{
return stringAppendList(lst);
}

stringAppend_rettype stringAppend(modelica_string_const s1, modelica_string_const s2)
{
int len1 = strlen(s1);
Expand Down
2 changes: 2 additions & 0 deletions c_runtime/meta_modelica_builtin.h
Expand Up @@ -177,6 +177,7 @@ typedef modelica_integer stringInt_rettype;
typedef modelica_metatype stringListStringChar_rettype;
typedef modelica_string_t listStringCharString_rettype;
typedef modelica_string_t stringAppendList_rettype;
typedef modelica_string_const stringAppendListExt_rettype;
typedef modelica_string_t stringAppend_rettype;
typedef modelica_integer stringLength_rettype;
typedef modelica_integer stringCompare_rettype;
Expand All @@ -188,6 +189,7 @@ stringInt_rettype stringInt(modelica_string_t);
stringListStringChar_rettype stringListStringChar(modelica_string_t);
listStringCharString_rettype listStringCharString(modelica_metatype);
stringAppendList_rettype stringAppendList(modelica_metatype);
stringAppendListExt_rettype stringAppendListExt(modelica_metatype);
stringAppend_rettype stringAppend(modelica_string_const,modelica_string_const);
stringLength_rettype stringLength(modelica_string_const);
stringCompare_rettype stringCompare(modelica_string_t,modelica_string_t);
Expand Down

0 comments on commit c6d51db

Please sign in to comment.