Commit e572c0c6 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Be more careful when including <time.h> and <sys/file.h> 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
parent 45a455c9
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'.
......
......@@ -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))
......
......@@ -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))
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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>
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment