import -ko -b 1.1.3 XEmacs XEmacs-21_2 r21-2-35
[chise/xemacs-chise.git.1] / lib-src / ellcc.c
index a116c9d..54a2c8b 100644 (file)
@@ -58,7 +58,7 @@ the lines of:
 See the samples for more details.
 */
 
-#include <../src/config.h>
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -71,8 +71,9 @@ See the samples for more details.
 #endif /* HAVE_UNISTD_H */
 
 #define EMODULES_GATHER_VERSION
-#include "emodules.h"
-#include "ellcc.h"
+
+#include <emodules.h>
+#include <ellcc.h> /* Generated files must be included using <...> */
 
 #define DEBUG
 
@@ -108,7 +109,7 @@ main (int argc, char *argv[])
 #endif
 static void *xmalloc (size_t);
 static void fatal (char *, char *);
-static void add_to_argv (CONST char *);
+static void add_to_argv (const char *);
 static void do_compile_mode (void);
 static void do_link_mode (void);
 static void do_init_mode (void);
@@ -148,7 +149,7 @@ main (int argc, char *argv[])
   prog_argc = argc;
   prog_argv = argv;
 
-#if defined(MSDOS) || defined(WINDOWSNT)
+#if defined(WIN32_NATIVE)
   tmp = strrchr (argv[0], '\\');
   if (tmp != (char *)0)
     tmp++;
@@ -345,12 +346,12 @@ fatal (char *s1, char *s2)
  * arguments, taking quoting into account. This can get ugly.
  */
 static void
-add_to_argv (CONST char *str)
+add_to_argv (const char *str)
 {
   int sm = 0;
-  CONST char *s = (CONST char *)0;
+  const char *s = (const char *)0;
 
-  if ((str == (CONST char *)0) || (str[0] == '\0'))
+  if ((str == (const char *)0) || (str[0] == '\0'))
     return;
 
   while (*str)
@@ -358,7 +359,7 @@ add_to_argv (CONST char *str)
       switch (sm)
         {
         case 0: /* Start of case - string leading whitespace */
-          if (isspace (*str))
+          if (isspace ((unsigned char) *str))
             str++;
           else
             {
@@ -368,7 +369,7 @@ add_to_argv (CONST char *str)
           break;
 
         case 1: /* Non-whitespace character. Mark the start */
-          if (isspace (*str))
+          if (isspace ((unsigned char) *str))
             {
               /* Reached the end of the argument. Add it. */
               int l = str-s;
@@ -377,7 +378,7 @@ add_to_argv (CONST char *str)
               exec_argv[real_argc][l] = '\0';
               real_argc++;
               sm = 0; /* Back to start state */
-              s = (CONST char *)0;
+              s = (const char *)0;
               break;
             }
           else if (*str == '\\')
@@ -422,14 +423,14 @@ add_to_argv (CONST char *str)
         }
     }
 
-  if (s != (CONST char *)0)
+  if (s != (const char *)0)
     {
       int l = str-s;
       exec_argv[real_argc] = xnew (l+2, char);
       strncpy (exec_argv[real_argc], s, l);
       exec_argv[real_argc][l] = '\0';
       real_argc++;
-      s = (CONST char *)0;
+      s = (const char *)0;
     }
 }