upcast parameters to varargs functions to int or generic pointers where appropriate
[fw/sdcc] / src / SDCCmain.c
index 514a54f7ffa5f478f4cd4365e584d4f07e15b89b..ea961cbbab4f30819a409a6756dc8d14d3bc005e 100644 (file)
 #endif
 
 // This is a bit messy because we define link ourself
-#ifndef __BORLANDC__
-#define link NoLiNk
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
+
 #include <unistd.h>
-#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) {