diff options
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r-- | gcc/cccp.c | 107 |
1 files changed, 26 insertions, 81 deletions
@@ -19,51 +19,37 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include <sys/types.h> -#include <sys/stat.h> -#include <ctype.h> -#include <stdio.h> -#include <signal.h> - -#ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> +#if defined (__STDC__) && defined (HAVE_VPRINTF) +# include <stdarg.h> +# define PRINTF_ALIST(msg) char *msg, ... +# define PRINTF_DCL(msg) +# define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n))) #else -# if HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -#endif -#endif - -#ifdef HAVE_SYS_RESOURCE_H -# include <sys/resource.h> -#endif - -#if HAVE_FCNTL_H -# include <fcntl.h> -#endif - -#if HAVE_LIMITS_H -# include <limits.h> -#endif - -#if HAVE_UNISTD_H -# include <unistd.h> +# include <varargs.h> +# define PRINTF_ALIST(msg) msg, va_alist +# define PRINTF_DCL(msg) char *msg; va_dcl +# define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n))) +# define vfprintf(file, msg, args) \ + { \ + char *a0 = va_arg(args, char *); \ + char *a1 = va_arg(args, char *); \ + char *a2 = va_arg(args, char *); \ + char *a3 = va_arg(args, char *); \ + fprintf (file, msg, a0, a1, a2, a3); \ + } #endif -#include <errno.h> +#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2) +#define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3) +#define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4) +#define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5) -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif +#include "system.h" +#include <sys/stat.h> +#include <signal.h> -#ifdef HAVE_STRING_H -# include <string.h> -#else -# ifdef HAVE_STRINGS_H -# include <strings.h> -#endif +#ifdef HAVE_SYS_RESOURCE_H +# include <sys/resource.h> #endif typedef unsigned char U_CHAR; @@ -71,18 +57,6 @@ typedef unsigned char U_CHAR; #include "gansidecl.h" #include "pcp.h" -#ifdef NEED_DECLARATION_INDEX -extern char *index (); -#endif - -#ifdef NEED_DECLARATION_RINDEX -extern char *rindex (); -#endif - -#ifdef NEED_DECLARATION_GETENV -extern char *getenv (); -#endif - #ifndef GET_ENVIRONMENT #define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME) #endif @@ -107,31 +81,6 @@ extern char *getenv (); # define OBJECT_SUFFIX ".o" #endif -#if defined (__STDC__) && defined (HAVE_VPRINTF) -# include <stdarg.h> -# define PRINTF_ALIST(msg) char *msg, ... -# define PRINTF_DCL(msg) -# define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n))) -#else -# include <varargs.h> -# define PRINTF_ALIST(msg) msg, va_alist -# define PRINTF_DCL(msg) char *msg; va_dcl -# define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n))) -# define vfprintf(file, msg, args) \ - { \ - char *a0 = va_arg(args, char *); \ - char *a1 = va_arg(args, char *); \ - char *a2 = va_arg(args, char *); \ - char *a3 = va_arg(args, char *); \ - fprintf (file, msg, a0, a1, a2, a3); \ - } -#endif - -#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2) -#define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3) -#define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4) -#define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5) - /* VMS-specific definitions */ #ifdef VMS #include <descrip.h> @@ -221,10 +170,6 @@ char *strerror (int,...); #endif HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT)); HOST_WIDE_INT parse_c_expression PROTO((char *, int)); - -#ifndef errno -extern int errno; -#endif /* Name under which this program was invoked. */ |