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
+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'.
#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))
extern char *update_path ();
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
#undef MIN
#undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
#include "cpplib.h"
#include "gansidecl.h"
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
-
extern void cpp_fatal ();
#if !__STDC__ && !defined(const)
#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 */
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>
# 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
# 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