patch: make fixincl use system.h

Robert Lipe robertl@sco.com
Fri May 28 14:49:00 GMT 1999


I know Jeff said to defer this to the mainline, but it's trivial to do
and it replaces some portability hair in fixincl with the better tested
portability hair in GCC itself.

I'd encourage this on the release branch and the trunk, but defer to
Jeff's wishes.

RJL

	* fixincl.c: Replace local include scheme with #includes of 
	gansidecl.h and system.h.
	* procopen.c:  Likewise.
	* server.c:  Likewise.


Index: fixincl.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/fixincl.c,v
retrieving revision 1.11.4.3
diff -u -p -r1.11.4.3 fixincl.c
--- fixincl.c	1999/05/26 03:03:28	1.11.4.3
+++ fixincl.c	1999/05/28 21:43:15
@@ -23,81 +23,9 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 #include "auto-host.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#else
- /* These definitions really belong in ../system.h, which we should be
-    using, (and some of them are), but for now they're here... */
-# ifndef WIFSIGNALED
-#  define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
-# endif
-# ifndef WTERMSIG
-#  define WTERMSIG(S) ((S) & 0x7f)
-# endif
-# ifndef WIFEXITED
-#  define WIFEXITED(S) (((S) & 0xff) == 0)
-# endif
-# ifndef WEXITSTATUS
-#  define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
-# endif
-# ifndef WIFSTOPPED
-#  define WIFSTOPPED(status)	((status) & 0100)
-# endif
-# ifndef WSTOPSIG
-#  define WSTOPSIG(status) \
-	((int)(WIFSTOPPED(status) ? (((status) >> 8) & 0177) : -1))
-# endif
-#endif
+#include "gansidecl.h"
+#include "system.h"
 #include <signal.h>
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#include <ctype.h>
-
-/* These definitions really belong in ../system.h, which we should be
-   using, but for now they're here... */
-#ifndef S_IRUSR			
-# ifdef S_IREAD
-#  define S_IRUSR  S_IREAD	/* read permission, owner */
-#  define S_IWUSR  S_IWRITE	/* write permission, owner */
-#  define S_IXUSR  S_IEXEC	/* execute/search permission, owner */
-# else
-#  define S_IRUSR  0000400	/* read permission, owner */
-#  define S_IWUSR  0000200	/* write permission, owner */
-#  define S_IXUSR  0000100	/* execute/search permission, owner */
-# endif
-#endif
-#ifndef S_IRGRP
-# define S_IRGRP  0000040	/* read permission, group */
-# define S_IWGRP  0000020	/* write permission, group */
-# define S_IXGRP  0000010	/* execute/search permission, group */
-#endif
-#ifndef S_IROTH
-# define S_IROTH  0000004	/* read permission, other */
-# define S_IWOTH  0000002	/* write permission, other */
-# define S_IXOTH  0000001	/* execute/search permission, group */
-#endif
-#ifndef S_IRWXU
-# define S_IRWXU  0000700	/* read, write, execute permission, owner */
-# define S_IRWXG  0000070	/* read, write, execute permission, group */
-# define S_IRWXO  0000007	/* read, write, execute permission, other */
-#endif
-
-/* Test if something is a normal file.  */
-#ifndef S_ISREG
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
 
 #include "gnu-regex.h"
 #include "server.h"
Index: procopen.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/procopen.c,v
retrieving revision 1.3.4.1
diff -u -p -r1.3.4.1 procopen.c
--- procopen.c	1999/05/20 07:15:13	1.3.4.1
+++ procopen.c	1999/05/28 21:43:17
@@ -46,17 +46,8 @@
  * If you do not wish that, delete this exception notice.
  */
 #include "auto-host.h"
-
-#include <sys/types.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#include <errno.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/param.h>
+#include "gansidecl.h"
+#include "system.h"
 
 #include "server.h"
 
Index: server.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/server.c,v
retrieving revision 1.6.4.1
diff -u -p -r1.6.4.1 server.c
--- server.c	1999/05/20 07:15:14	1.6.4.1
+++ server.c	1999/05/28 21:43:17
@@ -46,17 +46,9 @@
  * If you do not wish that, delete this exception notice.
  */
 #include "auto-host.h"
-
-#include <sys/types.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#include <errno.h>
+#include "gansidecl.h"
+#include "system.h"
 #include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/param.h>
 
 #include "server.h"
 


More information about the Gcc-patches mailing list