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> 1998-05-06 Mark Mitchell <mmitchell@usa.net>
* tree.h (IS_EXPR_CODE_CLASS): Remove bogus '3'. * tree.h (IS_EXPR_CODE_CLASS): Remove bogus '3'.
......
...@@ -105,10 +105,6 @@ static void hack_vms_include_specification (); ...@@ -105,10 +105,6 @@ static void hack_vms_include_specification ();
#define INO_T_EQ(a, b) 0 #define INO_T_EQ(a, b) 0
#endif #endif
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
#undef MIN #undef MIN
#undef MAX #undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
......
...@@ -45,10 +45,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -45,10 +45,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern char *update_path (); extern char *update_path ();
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
#undef MIN #undef MIN
#undef MAX #undef MAX
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
......
...@@ -77,10 +77,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -77,10 +77,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h" #include "cpplib.h"
#include "gansidecl.h" #include "gansidecl.h"
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
extern void cpp_fatal (); extern void cpp_fatal ();
#if !__STDC__ && !defined(const) #if !__STDC__ && !defined(const)
......
...@@ -75,11 +75,6 @@ extern void set_std_prefix PROTO((char *, int)); ...@@ -75,11 +75,6 @@ extern void set_std_prefix PROTO((char *, int));
#define exit __posix_exit #define exit __posix_exit
#endif #endif
/* Define O_RDONLY if the system hasn't defined it for us. */
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
#ifdef USG #ifdef USG
#define vfork fork #define vfork fork
#endif /* USG */ #endif /* USG */
......
...@@ -144,14 +144,6 @@ typedef char * pointer_type; ...@@ -144,14 +144,6 @@ typedef char * pointer_type;
typedef char * const_pointer_type; typedef char * const_pointer_type;
#endif #endif
#ifndef O_RDONLY
#define O_RDONLY 0
#endif
#ifndef O_WRONLY
#define O_WRONLY 1
#endif
#if defined(POSIX) #if defined(POSIX)
#include <signal.h> #include <signal.h>
......
...@@ -104,16 +104,20 @@ extern int errno; ...@@ -104,16 +104,20 @@ extern int errno;
# include <time.h> # include <time.h>
#else #else
# if HAVE_SYS_TIME_H # if HAVE_SYS_TIME_H
# include <sys/time.h> # include <sys/time.h>
# else # else
# include <time.h> # ifdef HAVE_TIME_H
#endif # include <time.h>
# endif
# endif
#endif #endif
#ifdef HAVE_FCNTL_H #ifdef HAVE_FCNTL_H
# include <fcntl.h> # include <fcntl.h>
#else #else
# include <sys/file.h> # ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
# endif
#endif #endif
#ifndef SEEK_SET #ifndef SEEK_SET
...@@ -127,6 +131,12 @@ extern int errno; ...@@ -127,6 +131,12 @@ extern int errno;
# define W_OK 2 # define W_OK 2
# define R_OK 4 # define R_OK 4
#endif #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