diff options
Diffstat (limited to 'gcc/system.h')
-rwxr-xr-x | gcc/system.h | 170 |
1 files changed, 7 insertions, 163 deletions
diff --git a/gcc/system.h b/gcc/system.h index 58b2e9c..e56eb8c 100755 --- a/gcc/system.h +++ b/gcc/system.h @@ -22,20 +22,9 @@ Boston, MA 02111-1307, USA. */ #ifndef __GCC_SYSTEM_H__ #define __GCC_SYSTEM_H__ -/* We must include stdarg.h/varargs.h before stdio.h. */ -#ifdef ANSI_PROTOTYPES #include <stdarg.h> -#else -#include <varargs.h> -#endif - #include <stdio.h> -/* Define a generic NULL if one hasn't already been defined. */ -#ifndef NULL -#define NULL 0 -#endif - /* The compiler is not a multi-threaded application and therefore we do not have to use the locking functions. */ #ifdef HAVE_PUTC_UNLOCKED @@ -113,21 +102,15 @@ Boston, MA 02111-1307, USA. */ #include <sys/types.h> #include <errno.h> - -#ifndef errno -extern int errno; -#endif - #include <string.h> - -#ifdef HAVE_STDLIB_H -# include <stdlib.h> -#endif +#include <stdlib.h> #ifdef HAVE_UNISTD_H # include <unistd.h> #endif +#include <sys/stat.h> + #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif @@ -157,11 +140,6 @@ extern int errno; # endif #endif -#ifndef SEEK_SET -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 -#endif #ifndef F_OK # define F_OK 0 # define X_OK 1 @@ -205,153 +183,19 @@ extern int errno; #define zero_memory(dst,len) memset((dst),0,(len)) -#ifdef NEED_DECLARATION_ATOF -extern double atof (); -#endif - -#ifdef NEED_DECLARATION_ATOL -extern long atol(); -#endif - -#ifdef NEED_DECLARATION_FREE -extern void free (); -#endif - -#ifdef NEED_DECLARATION_GETCWD -extern char *getcwd (); -#endif - -#ifdef NEED_DECLARATION_GETENV -extern char *getenv (); -#endif - -#ifdef NEED_DECLARATION_GETWD -extern char *getwd (); -#endif - -#ifdef NEED_DECLARATION_SBRK -extern char *sbrk (); -#endif - -#ifdef HAVE_STRERROR -# ifdef NEED_DECLARATION_STRERROR -# ifndef strerror -extern char *strerror (); -# endif -# endif -#else /* ! HAVE_STRERROR */ -extern int sys_nerr; -extern char *sys_errlist[]; -#endif /* HAVE_STRERROR */ - -#ifdef HAVE_STRSIGNAL -# ifdef NEED_DECLARATION_STRSIGNAL -# ifndef strsignal -extern char * strsignal (); -# endif -# endif -#else /* ! HAVE_STRSIGNAL */ -# ifndef SYS_SIGLIST_DECLARED -# ifndef NO_SYS_SIGLIST -extern char * sys_siglist[]; -# endif -# endif -#endif /* HAVE_STRSIGNAL */ - -#ifdef HAVE_GETRLIMIT -# ifdef NEED_DECLARATION_GETRLIMIT -# ifndef getrlimit -extern int getrlimit (); -# endif -# endif -#endif - -#ifdef HAVE_SETRLIMIT -# ifdef NEED_DECLARATION_SETRLIMIT -# ifndef setrlimit -extern int setrlimit (); -# endif -# endif -#endif - -/* HAVE_VOLATILE only refers to the stage1 compiler. We also check - __STDC__ and assume gcc sets it and has volatile in stage >=2. */ -#if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile) -#define volatile -#endif - /* Redefine abort to report an internal error w/o coredump, and reporting the location of the error in the source file. */ -#ifndef abort -#ifndef __STDC__ -#ifndef __GNUC__ -#ifndef USE_SYSTEM_ABORT -#define USE_SYSTEM_ABORT -#endif /* !USE_SYSTEM_ABORT */ -#endif /* !__GNUC__ */ -#endif /* !__STDC__ */ - -#ifdef USE_SYSTEM_ABORT -# ifdef NEED_DECLARATION_ABORT -extern void abort (); -# endif -#else -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -#define abort() \ -(fprintf (stderr, \ - "%s:%d: Internal compiler error\n", __FILE__, __LINE__), \ - exit (FATAL_EXIT_CODE)) -#else -#if 1 -/* CYGNUS LOCAL where to report bugs -- general */ -#define abort() \ -(fprintf (stderr, \ - "%s:%d: Internal compiler error in function %s\n" \ - "Please submit a Problem Report to Cygnus Solutions with send-pr.\n", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__), \ - exit (FATAL_EXIT_CODE)) -#else -#define abort() \ -(fprintf (stderr, \ - "%s:%d: Internal compiler error in function %s\n" \ - "Please submit a full bug report to `egcs-bugs@cygnus.com'.\n" \ - "See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.\n", \ - __FILE__, __LINE__, __PRETTY_FUNCTION__), \ - exit (FATAL_EXIT_CODE)) -#endif -/* END CYGNUS LOCAL */ -#endif /* recent gcc */ -#endif /* USE_SYSTEM_ABORT */ -#endif /* !abort */ - - -/* Define a STRINGIFY macro that's right for ANSI or traditional C. - HAVE_CPP_STRINGIFY only refers to the stage1 compiler. Assume that - (non-traditional) gcc used in stage2 or later has this feature. - - Note: if the argument passed to STRINGIFY is itself a macro, eg - #define foo bar, STRINGIFY(foo) will produce "foo", not "bar". - Although the __STDC__ case could be made to expand this via a layer - of indirection, the traditional C case can not do so. Therefore - this behavior is not supported. */ -#ifndef STRINGIFY -# if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__)) -# define STRINGIFY(STRING) #STRING -# else -# define STRINGIFY(STRING) "STRING" -# endif -#endif /* ! STRINGIFY */ +#define abort() \ + (fprintf (stderr, "%s:%d: Internal compiler error\n", __FILE__, __LINE__), \ + exit (FATAL_EXIT_CODE)) +#define STRINGIFY(STRING) #STRING /* These macros are here in preparation for the use of gettext in egcs. */ #define _(String) String #define N_(String) String -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif - /* Test if something is a normal file. */ #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |