Skip to content

Commit

Permalink
- use MoveFileEx on Windows for System.rename
Browse files Browse the repository at this point in the history
- remove System.renameFile (as we have System.rename)
- Causalize.mo do not create something that is not used!

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18043 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Nov 7, 2013
1 parent 784638e commit 6797940
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 0 additions & 2 deletions Compiler/BackEnd/Causalize.mo
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ algorithm
m := BackendDAEUtil.absIncidenceMatrix(m);
mT := BackendDAEUtil.absIncidenceMatrix(mT);
// try to match
ass1 := arrayCreate(nVars,-1);
ass2 := arrayCreate(nEqns,-1);
outSyst := BackendDAE.EQSYSTEM(vars,eqns,SOME(m),SOME(mT),BackendDAE.NO_MATCHING(),stateSets);
// do matching
(outSyst as BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=ass1,ass2=ass2)),_,_) := matchingFunc(outSyst,iShared,true,(BackendDAE.INDEX_REDUCTION(),eqnConstr),foundSingularSystem,arg);
Expand Down
7 changes: 0 additions & 7 deletions Compiler/Util/System.mo
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,6 @@ public function removeFile "Removes a file, returns 0 if suceeds, implemented us
external "C" res=SystemImpl__removeFile(fileName) annotation(Library = "omcruntime");
end removeFile;

public function renameFile "Renames a file, returns 0 if suceeds, implemented using rename() in stdio.h"
input String fileName1;
input String fileName2;
output Integer res;
external "C" res=rename(fileName1,fileName2) annotation(Include="#include <stdio.h>");
end renameFile;

public function directoryExists
input String inString;
output Boolean outBool;
Expand Down
7 changes: 0 additions & 7 deletions Compiler/runtime/System_rml.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,6 @@ RML_BEGIN_LABEL(System__removeFile)
}
RML_END_LABEL

RML_BEGIN_LABEL(System__renameFile)
{
rmlA0 = (void*) mk_icon(rename(RML_STRINGDATA(rmlA0),RML_STRINGDATA(rmlA1)));
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

double next_realelt(double *arr)
{
static int curpos;
Expand Down
3 changes: 3 additions & 0 deletions Compiler/runtime/systemimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2458,6 +2458,9 @@ int SystemImpl__fileContentsEqual(const char *file1, const char *file2)

int SystemImpl__rename(const char *source, const char *dest)
{
#if defined(__MINGW32__) || defined(_MSC_VER)
return MoveFileEx(source, dest, MOVEFILE_REPLACE_EXISTING);
#endif
return 0==rename(source,dest);
}

Expand Down

0 comments on commit 6797940

Please sign in to comment.