From e572c0c68c9d1a48595039af480e18e7d4bdb292 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 6 May 1998 07:58:27 +0000 Subject: Be more careful when including and in system.h. Consolidate O_RDONLY/O_WRONLY fallback definitions from various files into system.h. * system.h: Wrap time.h and sys/file.h in autoconf checks. Provide default definitions for O_RDONLY and O_WRONLY here. * cccp.c, cpplib.c, fix-header.c, gcc.c, protoize.c: Not here. From-SVN: r19571 --- gcc/system.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gcc/system.h') diff --git a/gcc/system.h b/gcc/system.h index e381c2d..468db6a 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -104,16 +104,20 @@ extern int errno; # include #else # if HAVE_SYS_TIME_H -# include +# include # else -# include -#endif +# ifdef HAVE_TIME_H +# include +# endif +# endif #endif #ifdef HAVE_FCNTL_H # include #else -# include +# ifdef HAVE_SYS_FILE_H +# include +# endif #endif #ifndef SEEK_SET @@ -127,6 +131,12 @@ extern int errno; # define W_OK 2 # define R_OK 4 #endif +#ifndef O_RDONLY +# define O_RDONLY 0 +#endif +#ifndef O_WRONLY +# define O_WRONLY 1 +#endif -- cgit v1.1