diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1998-04-06 14:01:33 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1998-04-06 14:01:33 +0000 |
commit | 944fc8abefc438b7087db07cdf81c1bbcb0faf26 (patch) | |
tree | 705fdf7fa2c894b86921a9d5b3c46a2bd38525cb /gcc/cexp.y | |
parent | 3286ab57366ae3422fdacff3c2e605ea81a29c44 (diff) | |
download | gcc-944fc8abefc438b7087db07cdf81c1bbcb0faf26.zip gcc-944fc8abefc438b7087db07cdf81c1bbcb0faf26.tar.gz gcc-944fc8abefc438b7087db07cdf81c1bbcb0faf26.tar.bz2 |
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
Diffstat (limited to 'gcc/cexp.y')
-rw-r--r-- | gcc/cexp.y | 64 |
1 files changed, 25 insertions, 39 deletions
@@ -1,5 +1,5 @@ /* Parse C expressions for CCCP. - Copyright (C) 1987, 1992, 1994, 1995, 1996, 1997 Free Software Foundation. + Copyright (C) 1987, 1992, 94 - 97, 1998 Free Software Foundation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -26,28 +26,38 @@ Boston, MA 02111-1307, USA. %{ #include "config.h" -#include <setjmp.h> -/* #define YYDEBUG 1 */ - - -#ifdef HAVE_STRING_H -# include <string.h> +#if defined (__STDC__) && defined (HAVE_VPRINTF) +# include <stdarg.h> +# define VA_START(va_list, var) va_start (va_list, var) +# 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 VA_START(va_list, var) va_start (va_list) +# 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 -#ifdef HAVE_STDLIB_H -# include <stdlib.h> -#endif +#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2) -#ifdef HAVE_LIMITS_H -# include <limits.h> -#endif +#include "system.h" +#include <setjmp.h> +/* #define YYDEBUG 1 */ #ifdef MULTIBYTE_CHARS #include <locale.h> #endif -#include <stdio.h> - typedef unsigned char U_CHAR; /* This is used for communicating lists of keywords with cccp.c. */ @@ -121,30 +131,6 @@ struct arglist { # endif #endif -#if defined (__STDC__) && defined (HAVE_VPRINTF) -# include <stdarg.h> -# define VA_START(va_list, var) va_start (va_list, var) -# 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 VA_START(va_list, var) va_start (va_list) -# 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) - HOST_WIDE_INT parse_c_expression PROTO((char *, int)); static int yylex PROTO((void)); |