]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
More system.h cutover patches:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Mon, 6 Apr 1998 14:01:33 +0000 (14:01 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Mon, 6 Apr 1998 14:01:33 +0000 (14:01 +0000)
        * 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

12 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/c-parse.c
gcc/c-parse.in
gcc/c-parse.y
gcc/cccp.c
gcc/cexp.c
gcc/cexp.y
gcc/objc/Make-lang.in
gcc/objc/objc-parse.c
gcc/objc/objc-parse.y
gcc/protoize.c

index 3a6db44977bf3db0895ccb98daa016d71eef1eaa..d35f141f7e07b7091fbf5caf9f45014bfc908dca 100644 (file)
@@ -1,3 +1,15 @@
+Mon Apr  6 16:08:04 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+        * 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.
+
 Mon Apr  6 14:59:58 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
         * gansidecl.h: Check if compiler supports __attribute__.  Provide
index ea37a4eaeb921c16b060a7715d6c3eaa78c16fa7..53749d6e02e4c3f69d155fa9a043d88c4bb36607 100644 (file)
@@ -1223,7 +1223,7 @@ s-crt0:   $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
 # C language specific files.
 
 c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
-    $(srcdir)/c-parse.h c-tree.h input.h flags.h
+    $(srcdir)/c-parse.h c-tree.h input.h flags.h system.h
        $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
 $(srcdir)/c-parse.h: $(srcdir)/c-parse.c
 $(srcdir)/c-parse.c: $(srcdir)/c-parse.y
@@ -1751,12 +1751,12 @@ cpp$(exeext): $(CCCP)$(exeext)
 cccp$(exeext): cccp.o cexp.o version.o prefix.o $(LIBDEPS)
        $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o \
          version.o $(LIBS)
-cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
+cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h
        $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
 $(srcdir)/cexp.c: $(srcdir)/cexp.y
        cd $(srcdir); $(BISON) -o cexp.c cexp.y
 
-cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status
+cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h
        $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
          -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
          -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
@@ -1808,7 +1808,7 @@ unprotoize$(exeext): unprotoize.o getopt.o getopt1.o getpwd.o version.o \
          unprotoize.o getopt.o getopt1.o getpwd.o version.o \
          pexecute.o choose-temp.o $(LIBS)
 
-protoize.o: protoize.c getopt.h $(CONFIG_H)
+protoize.o: protoize.c getopt.h $(CONFIG_H) system.h
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
          -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
@@ -1818,7 +1818,7 @@ protoize.o: protoize.c getopt.h $(CONFIG_H)
          -DSTD_PROTO_DIR=\"$(libsubdir)\" \
          $(srcdir)/protoize.c
 
-unprotoize.o: unprotoize.c protoize.c getopt.h $(CONFIG_H)
+unprotoize.o: unprotoize.c protoize.c getopt.h $(CONFIG_H) system.h
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
           -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
          -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
index 9b473277fe7459219d2d5b2316926c28cc247f63..8777295d248cefd81a57e0419e5865e1ba99cc99 100644 (file)
@@ -68,9 +68,7 @@
 #line 56 "c-parse.y"
 
 #include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
 #include <setjmp.h>
 
 #include "tree.h"
@@ -81,7 +79,6 @@
 #include "output.h"
 
 #ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
 #include <locale.h>
 #endif
 
    definition here.  */
 char *language_string = "GNU C";
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index 76e7ca9dcf19dff9a1c8576568cbf52008609004..fbfa994cd6e7491afb89037e5c5d120f813b6af6 100644 (file)
@@ -59,9 +59,7 @@ end ifc
 
 %{
 #include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
 #include <setjmp.h>
 
 #include "tree.h"
@@ -72,7 +70,6 @@ end ifc
 #include "output.h"
 
 #ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
 #include <locale.h>
 #endif
 
@@ -89,10 +86,6 @@ ifc
 char *language_string = "GNU C";
 end ifc
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index ac9138df39340ff02fa91f3550e83edee20fc4a2..aba326d02b962fcd174585e45d1a253aa18659fd 100644 (file)
@@ -55,9 +55,7 @@ State 434 contains 2 shift/reduce conflicts.  (Four ways to parse this.)  */
 
 %{
 #include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
 #include <setjmp.h>
 
 #include "tree.h"
@@ -68,7 +66,6 @@ State 434 contains 2 shift/reduce conflicts.  (Four ways to parse this.)  */
 #include "output.h"
 
 #ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
 #include <locale.h>
 #endif
 
@@ -77,10 +74,6 @@ State 434 contains 2 shift/reduce conflicts.  (Four ways to parse this.)  */
    definition here.  */
 char *language_string = "GNU C";
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index edaf5440b85a8dee5465cc3ff89bb25cbd592f73..ebb42fbf0bcf1367b6b486c76680b0293261e6ac 100644 (file)
@@ -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
 \f
 /* Name under which this program was invoked.  */
 
index de021e09559cf70b7c136bf95a237cc985e287fe..4e3a1467d140e916af7da9865db7c660e2e00e12 100644 (file)
 #line 27 "cexp.y"
 
 #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.  */
@@ -117,30 +127,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));
index 5269c5bae7e12e9460cbd209f61ca4ad5e8e9ed8..346f83e44cc84f290da4265a651eb5cca5cb20ff 100644 (file)
@@ -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));
index 4b41c9a1433fc8adbe1578cfe0b913e10e30563d..ebde9d0101b899bed45a57150e2f51a29138e879 100644 (file)
@@ -71,7 +71,7 @@ cc1obj$(exeext): $(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
 objc-parse.o : $(srcdir)/objc/objc-parse.c \
    $(CONFIG_H) $(TREE_H) \
    $(srcdir)/c-lex.h $(srcdir)/c-tree.h $(srcdir)/input.h \
-   $(srcdir)/flags.h $(srcdir)/output.h $(srcdir)/objc/objc-act.h
+   $(srcdir)/flags.h $(srcdir)/output.h $(srcdir)/objc/objc-act.h system.h
        $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/objc \
        -c $(srcdir)/objc/objc-parse.c
 
index cf3f3f708041041dcb9ad47e95d07679531e58d4..abb9099469ac84b5fae0627e481bf311347ba6be 100644 (file)
@@ -68,9 +68,7 @@
 #line 33 "objc-parse.y"
 
 #include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
 #include <setjmp.h>
 
 #include "tree.h"
@@ -81,7 +79,6 @@
 #include "output.h"
 
 #ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
 #include <locale.h>
 #endif
 
    definition here.  */
 char *language_string = "GNU Obj-C";
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index 807ad5a952c9a2489a77a2f45aceb10169837401..c216d438ae1782bbb40adb7ac716ec260bb61292 100644 (file)
@@ -32,9 +32,7 @@ Boston, MA 02111-1307, USA.  */
 
 %{
 #include "config.h"
-
-#include <stdio.h>
-#include <errno.h>
+#include "system.h"
 #include <setjmp.h>
 
 #include "tree.h"
@@ -45,7 +43,6 @@ Boston, MA 02111-1307, USA.  */
 #include "output.h"
 
 #ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
 #include <locale.h>
 #endif
 
@@ -55,10 +52,6 @@ Boston, MA 02111-1307, USA.  */
    definition here.  */
 char *language_string = "GNU Obj-C";
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Like YYERROR but do call yyerror.  */
 #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
 
index 8efad717662b3ef415171e77723abd89d8fcf072..e61e92e6be2b41a74df1f34e6a1c29093f4b3ed6 100644 (file)
@@ -57,20 +57,12 @@ Boston, MA 02111-1307, USA.  */
 #define _POSIX_SOURCE
 #endif
 
-#ifdef HAVE_VARARGS_H
-#include <varargs.h>
+#ifdef __STDC__
+#include <stdarg.h>
 #else
-#ifdef HAVE_SYS_VARARGS_H
-#include <sys/varargs.h>
-#endif
+#include <varargs.h>
 #endif
-
-/* On some systems stdio.h includes stdarg.h;
-   we must bring in varargs.h first.  */
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include <sys/types.h>
+#include "system.h"
 #include <sys/stat.h>
 #if ! defined (_WIN32) || defined (__CYGWIN32__)
 #if defined(POSIX) || defined(CONCURRENT)
@@ -80,23 +72,6 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 #include <setjmp.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
 #include "gansidecl.h"
 
 /* Include getopt.h for the sake of getopt_long.
@@ -106,10 +81,6 @@ Boston, MA 02111-1307, USA.  */
 #include "getopt.h"
 #undef getopt
 
-#ifndef errno
-extern int errno;
-#endif
-
 #ifndef HAVE_STRERROR
 extern int sys_nerr;
 extern char *sys_errlist[];
@@ -161,23 +132,6 @@ typedef char * pointer_type;
 typedef char * const_pointer_type;
 #endif
 
-#if defined(POSIX)
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-
-#else /* !defined(POSIX) */
-
-#ifndef F_OK
-#define R_OK    4       /* Test for Read permission */
-#define W_OK    2       /* Test for Write permission */
-#define X_OK    1       /* Test for eXecute permission */
-#define F_OK    0       /* Test for existence of File */
-#endif
-
 #ifndef O_RDONLY
 #define O_RDONLY        0
 #endif
@@ -186,6 +140,13 @@ typedef char * const_pointer_type;
 #define O_WRONLY        1
 #endif
 
+#if defined(POSIX)
+
+#include <signal.h>
+#include <sys/wait.h>
+
+#else /* !defined(POSIX) */
+
 #ifndef WIFSIGNALED
 #define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
 #endif
@@ -232,17 +193,13 @@ extern size_t   strlen ()
 
 #endif /* !defined (POSIX) */
 
-#ifdef NEED_DECLARATION_RINDEX
-extern char *rindex ();
-#endif
-
 /* Look for these where the `const' qualifier is intentionally cast aside.  */
 
 #define NONCONST
 
 /* Define a STRINGIFY macro that's right for ANSI or traditional C.  */
 
-#ifdef __STDC__
+#if defined(HAVE_CPP_STRINGIFY) || (defined(__GNUC__) && defined(__STDC__))
 #define STRINGIFY(STRING) #STRING
 #else
 #define STRINGIFY(STRING) "STRING"