From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kaveh R. Ghazi" To: egcs@cygnus.com Subject: egcs-19980425, system.h stuff part 1/6 Date: Fri, 01 May 1998 21:25:00 -0000 Message-id: <199805020030.UAA12176@caip.rutgers.edu> X-SW-Source: 1998-05/msg00024.html This is part 1/6. Note, only one file remained in objc/ to get system.h. The rest are part of libobjc.a and are moving out. Fri May 1 12:58:40 1998 Kaveh R. Ghazi * Makefile.in (mips-tfile.o, mips-tdump.o): Depend on system.h. * mips-tdump.c: Include system.h, remove redundant headers. * mips-tfile.c: Likewise. Convert all ctype function calls to macro versions defined in system.h. * objc/Make-lang.in (objc-act.o): Depend on system.h. * objc/objc-act.c: Include system.h, remove redundant headers. diff -rup orig/egcs-19980425/gcc/Makefile.in egcs-19980425/gcc/Makefile.in --- orig/egcs-19980425/gcc/Makefile.in Thu Apr 23 19:04:07 1998 +++ egcs-19980425/gcc/Makefile.in Fri May 1 15:43:55 1998 @@ -1442,12 +1442,12 @@ $(out_object_file): $(out_file) $(CONFIG mips-tfile: mips-tfile.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) -mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) +mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h mips-tdump: mips-tdump.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) -mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) +mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h # Build file to support OSF/rose half-pic format. halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h diff -rup orig/egcs-19980425/gcc/mips-tdump.c egcs-19980425/gcc/mips-tdump.c --- orig/egcs-19980425/gcc/mips-tdump.c Fri Apr 3 11:36:16 1998 +++ egcs-19980425/gcc/mips-tdump.c Fri May 1 15:43:55 1998 @@ -21,12 +21,7 @@ the Free Software Foundation, 59 Temple Boston, MA 02111-1307, USA. */ #include "config.h" -#include -#include -#include -#include -#include -#include +#include "system.h" #ifdef index #undef index diff -rup orig/egcs-19980425/gcc/mips-tfile.c egcs-19980425/gcc/mips-tfile.c --- orig/egcs-19980425/gcc/mips-tfile.c Sat Apr 4 12:38:18 1998 +++ egcs-19980425/gcc/mips-tfile.c Fri May 1 15:44:45 1998 @@ -605,7 +605,7 @@ Boston, MA 02111-1307, USA. */ #else #include #endif -#include +#include "system.h" #ifndef __SABER__ #define saber_stop() @@ -705,11 +705,6 @@ main () #undef rindex #undef index -#include -#include -#include -#include -#include #include #include @@ -731,23 +726,6 @@ main () #define STAB_CODE_TYPE int #endif -#ifdef _OSF_SOURCE -#define HAS_STDLIB_H -#define HAS_UNISTD_H -#endif - -#ifdef HAS_STDLIB_H -#include -#endif - -#ifdef HAS_UNISTD_H -#include -#endif - -#ifndef errno -extern int errno; /* MIPS errno.h doesn't declare this */ -#endif - #ifndef MALLOC_CHECK #ifdef __SABER__ #define MALLOC_CHECK @@ -755,7 +733,7 @@ extern int errno; /* MIPS errno.h does #endif #define IS_ASM_IDENT(ch) \ - (isalnum (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$') + (ISALNUM (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$') /* Redefinition of of storage classes as an enumeration for better @@ -1755,13 +1733,6 @@ STATIC void free_thead __proto((thead STATIC char *local_index __proto((const char *, int)); STATIC char *local_rindex __proto((const char *, int)); -#ifdef NEED_DECLARATION_SBRK -extern char *sbrk __proto((int)); -#endif -#ifdef NEED_DECLARATION_FREE -extern void free __proto((PTR_T)); -#endif - extern char *mktemp __proto((char *)); extern long strtol __proto((const char *, char **, int)); @@ -1775,12 +1746,6 @@ extern char *sys_siglist[NSIG + 1]; #endif #endif -#ifndef SEEK_SET /* Symbolic constants for the "fseek" function: */ -#define SEEK_SET 0 /* Set file pointer to offset */ -#define SEEK_CUR 1 /* Set file pointer to its current value plus offset */ -#define SEEK_END 2 /* Set file pointer to the size of the file plus offset */ -#endif - /* List of assembler pseudo ops and beginning sequences that need special actions. Someday, this should be a hash table, and such, @@ -2835,7 +2800,7 @@ parse_begin (start) return; } - for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++) + for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++) ; hash_ptr = hash_string (start, @@ -2885,7 +2850,7 @@ parse_bend (start) return; } - for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++) + for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++) ; hash_ptr = hash_string (start, @@ -2995,7 +2960,7 @@ parse_def (name_start) (ch = *dir_end_p1) != ' ' && ch != '\t'; dir_end_p1++) { - if (ch == '\0' || isspace (ch)) + if (ch == '\0' || ISSPACE (ch)) { error_line = __LINE__; saber_stop (); @@ -3011,7 +2976,7 @@ parse_def (name_start) while (ch == ' ' || ch == '\t') ch = *++arg_start; - if (isdigit (ch) || ch == '-' || ch == '+') + if (ISDIGIT (ch) || ch == '-' || ch == '+') { int ch2; arg_number = strtol (arg_start, (char **) &arg_end_p1, 0); @@ -3019,7 +2984,7 @@ parse_def (name_start) arg_was_number++; } - else if (ch == '\0' || isspace (ch)) + else if (ch == '\0' || ISSPACE (ch)) { error_line = __LINE__; saber_stop (); @@ -3067,7 +3032,7 @@ parse_def (name_start) ch = *++arg_start; arg_was_number = 0; - if (isdigit (ch) || ch == '-' || ch == '+') + if (ISDIGIT (ch) || ch == '-' || ch == '+') { int ch2; arg_number = strtol (arg_start, (char **) &arg_end_p1, 0); @@ -3141,7 +3106,7 @@ parse_def (name_start) ch = *++arg_start; arg_was_number = 0; - if (isdigit (ch) || ch == '-' || ch == '+') + if (ISDIGIT (ch) || ch == '-' || ch == '+') { int ch2; arg_number = strtol (arg_start, (char **) &arg_end_p1, 0); @@ -3520,7 +3485,7 @@ parse_end (start) } /* Get the function name, skipping whitespace. */ - for (start_func = start; isspace (*start_func); start_func++) + for (start_func = start; ISSPACE (*start_func); start_func++) ; ch = *start_func; @@ -3579,7 +3544,7 @@ parse_ent (start) return; } - for (start_func = start; isspace (*start_func); start_func++) + for (start_func = start; ISSPACE (*start_func); start_func++) ; ch = *start_func; @@ -3689,7 +3654,7 @@ parse_stabs_common (string_start, string mark_stabs (""); /* Read code from stabs. */ - if (!isdigit (*rest)) + if (!ISDIGIT (*rest)) { error ("Invalid .stabs/.stabn directive, code is non-numeric"); return; @@ -3709,7 +3674,7 @@ parse_stabs_common (string_start, string shash_t *shash_ptr; /* Skip ,0, */ - if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !isdigit (p[3])) + if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !ISDIGIT (p[3])) { error ("Invalid line number .stabs/.stabn directive"); return; @@ -3717,7 +3682,7 @@ parse_stabs_common (string_start, string code = strtol (p+3, &p, 0); ch = *++p; - if (p[-1] != ',' || isdigit (ch) || !IS_ASM_IDENT (ch)) + if (p[-1] != ',' || ISDIGIT (ch) || !IS_ASM_IDENT (ch)) { error ("Invalid line number .stabs/.stabn directive"); return; @@ -3759,11 +3724,11 @@ parse_stabs_common (string_start, string /* Skip ,,, */ if (*p++ != ',') goto failure; - for (; isdigit (*p); p++) + for (; ISDIGIT (*p); p++) ; if (*p++ != ',') goto failure; - for (; isdigit (*p); p++) + for (; ISDIGIT (*p); p++) ; if (*p++ != ',') goto failure; @@ -3775,7 +3740,7 @@ parse_stabs_common (string_start, string return; } - if (isdigit (ch) || ch == '-') + if (ISDIGIT (ch) || ch == '-') { st = st_Nil; sc = sc_Nil; @@ -3843,7 +3808,7 @@ parse_stabs_common (string_start, string ch = *end_p1++; if (ch != '\n') { - if (((!isdigit (*end_p1)) && (*end_p1 != '-')) + if (((!ISDIGIT (*end_p1)) && (*end_p1 != '-')) || ((ch != '+') && (ch != '-'))) { error ("Invalid .stabs/.stabn directive, badly formed value"); @@ -3919,16 +3884,16 @@ parse_input __proto((void)) while ((p = read_line ()) != (char *) 0) { /* Skip leading blanks */ - while (isspace (*p)) + while (ISSPACE (*p)) p++; /* See if it's a directive we handle. If so, dispatch handler. */ for (i = 0; i < sizeof (pseudo_ops) / sizeof (pseudo_ops[0]); i++) if (memcmp (p, pseudo_ops[i].name, pseudo_ops[i].len) == 0 - && isspace (p[pseudo_ops[i].len])) + && ISSPACE (p[pseudo_ops[i].len])) { p += pseudo_ops[i].len; /* skip to first argument */ - while (isspace (*p)) + while (ISSPACE (*p)) p++; (*pseudo_ops[i].func)( p ); diff -rup orig/egcs-19980425/gcc/objc/Make-lang.in egcs-19980425/gcc/objc/Make-lang.in --- orig/egcs-19980425/gcc/objc/Make-lang.in Mon Apr 6 10:01:33 1998 +++ egcs-19980425/gcc/objc/Make-lang.in Fri May 1 15:43:56 1998 @@ -87,7 +87,7 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc/objc-parse.y objc-act.o : $(srcdir)/objc/objc-act.c \ - $(CONFIG_H) $(TREE_H) $(RTL_H) \ + $(CONFIG_H) $(TREE_H) $(RTL_H) system.h \ $(srcdir)/c-tree.h $(srcdir)/c-lex.h \ $(srcdir)/flags.h $(srcdir)/objc/objc-act.h $(srcdir)/input.h \ $(srcdir)/function.h $(srcdir)/output.h $(srcdir)/c-parse.h diff -rup orig/egcs-19980425/gcc/objc/objc-act.c egcs-19980425/gcc/objc/objc-act.c --- orig/egcs-19980425/gcc/objc/objc-act.c Sun Apr 5 21:05:12 1998 +++ egcs-19980425/gcc/objc/objc-act.c Fri May 1 15:43:57 1998 @@ -39,10 +39,7 @@ Boston, MA 02111-1307, USA. */ - OBJC_INT_SELECTORS */ #include "config.h" -#include -#ifdef HAVE_STDLIB_H -#include -#endif +#include "system.h" #include "tree.h" #include "c-tree.h" #include "c-lex.h" @@ -51,7 +48,6 @@ Boston, MA 02111-1307, USA. */ #include "input.h" #include "except.h" #include "function.h" -#include #include "output.h" /* This is the default way of generating a method name. */