Skip to content

Commit

Permalink
- fixed compilation on Windows MSVC/OMDev
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5667 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Jun 15, 2010
1 parent 7bf6324 commit 4830f97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Compiler/runtime/systemimpl.c
Expand Up @@ -72,7 +72,6 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include "systemimpl.h"
#include "rml.h"
Expand All @@ -96,6 +95,7 @@
#include <dirent.h>
#include <sys/param.h> /* MAXPATHLEN */
#include <sys/unistd.h>
#include <sys/wait.h> /* only available in Linux, not windows */
#include <unistd.h>
#include <dlfcn.h>

Expand Down Expand Up @@ -1462,7 +1462,7 @@ RML_END_LABEL
/* is the same for both Windows/Linux */
RML_BEGIN_LABEL(System__systemCall)
{
int status,ret_val;
int status = -1,ret_val = -1;
char* str = RML_STRINGDATA(rmlA0);

if (rml_trace_enabled)
Expand All @@ -1472,10 +1472,14 @@ RML_BEGIN_LABEL(System__systemCall)

status = system(str);

#if defined(__MINGW32__) || defined(_MSC_VER)
ret_val = status;
#else
if (WIFEXITED(status)) /* Did the process exit normally? */
ret_val = WEXITSTATUS(status); /* Fetch the actual exit status */
else
ret_val = -1;
#endif

if (rml_trace_enabled)
{
Expand Down

0 comments on commit 4830f97

Please sign in to comment.