From 944fc8abefc438b7087db07cdf81c1bbcb0faf26 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Mon, 6 Apr 1998 14:01:33 +0000 Subject: More system.h cutover patches: * c-parse.in: Include system.h, and remove stuff now made redundant. * cccp.c: Likewise. * cexp.y: Likewise. * protoize.c: Likewise. Properly check for cpp stringification. * Makefile.in (c-parse.o, cccp.o, cexp.o, protoize.o, unprotoize.o): Depend on system.h. * objc/Make-lang.in (objc-parse.o): Likewise. From-SVN: r19020 --- gcc/cccp.c | 107 +++++++++++++++---------------------------------------------- 1 file changed, 26 insertions(+), 81 deletions(-) (limited to 'gcc/cccp.c') diff --git a/gcc/cccp.c b/gcc/cccp.c index edaf544..ebb42fb 100644 --- a/gcc/cccp.c +++ b/gcc/cccp.c @@ -19,51 +19,37 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" -#include -#include -#include -#include -#include - -#ifdef TIME_WITH_SYS_TIME -# include -# include +#if defined (__STDC__) && defined (HAVE_VPRINTF) +# include +# 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 -# else -# include -#endif -#endif - -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif - -#if HAVE_FCNTL_H -# include -#endif - -#if HAVE_LIMITS_H -# include -#endif - -#if HAVE_UNISTD_H -# include +# include +# 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 +#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 -#endif +#include "system.h" +#include +#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -#endif +#ifdef HAVE_SYS_RESOURCE_H +# include #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 -# 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 -# 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 @@ -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. */ -- cgit v1.1