summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cccp.c4
-rw-r--r--gcc/cpplib.c4
-rw-r--r--gcc/fix-header.c4
-rw-r--r--gcc/gcc.c5
-rw-r--r--gcc/protoize.c8
-rw-r--r--gcc/system.h18
7 files changed, 21 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 052ef5bb094..f4ff118ab01 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Wed May 6 10:52:49 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
1998-05-06 Mark Mitchell <mmitchell@usa.net>
* tree.h (IS_EXPR_CODE_CLASS): Remove bogus '3'.
diff --git a/gcc/cccp.c b/gcc/cccp.c
index ed4d5c6495a..165dfdcfa6d 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -105,10 +105,6 @@ static void hack_vms_include_specification ();
#define INO_T_EQ(a, b) 0
#endif
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
#undef MIN
#undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 3d1fd92c2c5..7fde93f5678 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -45,10 +45,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern char *update_path ();
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
#undef MIN
#undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 6646717ed6f..cb3238d0153 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -77,10 +77,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h"
#include "gansidecl.h"
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
extern void cpp_fatal ();
#if !__STDC__ && !defined(const)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index fa47ee3a5db..312af6dd4f3 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -75,11 +75,6 @@ extern void set_std_prefix PROTO((char *, int));
#define exit __posix_exit
#endif
-/* Define O_RDONLY if the system hasn't defined it for us. */
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
#ifdef USG
#define vfork fork
#endif /* USG */
diff --git a/gcc/protoize.c b/gcc/protoize.c
index 70599879bbc..7d81aeae4ff 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -144,14 +144,6 @@ typedef char * pointer_type;
typedef char * const_pointer_type;
#endif
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
-#ifndef O_WRONLY
-#define O_WRONLY 1
-#endif
-
#if defined(POSIX)
#include <signal.h>
diff --git a/gcc/system.h b/gcc/system.h
index e381c2db794..468db6a667a 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -104,16 +104,20 @@ extern int errno;
# include <time.h>
#else
# if HAVE_SYS_TIME_H
-# include <sys/time.h>
+# include <sys/time.h>
# else
-# include <time.h>
-#endif
+# ifdef HAVE_TIME_H
+# include <time.h>
+# endif
+# endif
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
-# include <sys/file.h>
+# ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+# 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