X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmain.c;h=ea961cbbab4f30819a409a6756dc8d14d3bc005e;hb=899ee91ab8169609f83f2c34c14d9112df2bb085;hp=514a54f7ffa5f478f4cd4365e584d4f07e15b89b;hpb=0945f81e351ad9b040be9ccd4037bb5d36cae518;p=fw%2Fsdcc diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 514a54f7..ea961cbb 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -32,10 +32,10 @@ #endif // This is a bit messy because we define link ourself -#ifndef __BORLANDC__ -#define link NoLiNk +#if !defined(__BORLANDC__) && !defined(_MSC_VER) + #include -#undef link + #else // No unistd.h in Borland C++ extern int access(const char *, int); @@ -123,6 +123,7 @@ char *preOutName; #define OPTION_NOSTDLIB "-nostdlib" #define OPTION_NOSTDINC "-nostdinc" #define OPTION_VERBOSE "-verbose" +#define OPTION_ANSIINT "-ansiint" static const char *_preCmd[] = { "sdcpp", "-Wall", "-lang-c++", "-DSDCC=1", "$l", "-I" SDCC_INCLUDE_DIR, "$1", "$2", NULL @@ -815,6 +816,11 @@ int parseCmdLine ( int argc, char **argv ) options.verbose=1; continue; } + + if (strcmp(&argv[i][1],OPTION_ANSIINT) == 0) { + options.ANSIint=1; + continue; + } if (!port->parseOption(&argc, argv, &i)) { @@ -1054,7 +1060,17 @@ int parseCmdLine ( int argc, char **argv ) /*-----------------------------------------------------------------*/ /* my_system - will call a program with arguments */ /*-----------------------------------------------------------------*/ + +#if defined(_MSC_VER) + +char *try_dir[]= {NULL}; // TODO : Fill in some default search list + +#else + char *try_dir[]= {SRCDIR "/bin",PREFIX "/bin", NULL}; + +#endif + int my_system (const char *cmd, char **cmd_argv) { char *dir, *got= NULL; int i= 0; @@ -1104,7 +1120,10 @@ int my_system (const char *cmd, char **cmd_argv) } if (got) + { i= spawnv(P_WAIT,got,cmd_argv) == -1; + free(got) ; + } else i= spawnvp(P_WAIT,cmd,cmd_argv) == -1; if (i) {