Skip to content

Commit

Permalink
- Fixed compilation errors in Visual C++.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@6482 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Daniel Hedberg committed Oct 20, 2010
1 parent 1021c80 commit 0de311e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Compiler/runtime/systemimpl.c
Expand Up @@ -44,7 +44,6 @@
/*
* Common includes
*/
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -72,6 +71,7 @@
#else

/* includes/defines specific for LINUX/OS X */
#include <libgen.h>
#include <ctype.h>
#include <dirent.h>
#include <sys/param.h> /* MAXPATHLEN */
Expand Down Expand Up @@ -428,10 +428,19 @@ RML_END_LABEL
RML_BEGIN_LABEL(System__basename)
{
const char *str = RML_STRINGDATA(rmlA0);
#if defined(__MINGW32__) || defined(_MSC_VER)
const char* res = strrchr(str, '\\');
if (res == NULL) {
res = strrchr(str, '/');
if (res == NULL) { res = str; }
}
rmlA0 = (void*) mk_scon(res);
#else
char *copy = strdup(str);
char *res = basename(copy); /* basename may modify the contents */
rmlA0 = (void*) mk_scon(res);
free(copy);
#endif
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL
Expand Down

0 comments on commit 0de311e

Please sign in to comment.