diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1998-03-20 14:58:42 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1998-03-20 14:58:42 +0000 |
commit | 670ee920976dbb37076758547de92cabf017843d (patch) | |
tree | d54887798fa85070a1ff0f7331e43ef538f2f78e /gcc/getpwd.c | |
parent | 1107c4b3ddb1932630ca4372701cf246192cf82e (diff) | |
download | gcc-670ee920976dbb37076758547de92cabf017843d.zip gcc-670ee920976dbb37076758547de92cabf017843d.tar.gz gcc-670ee920976dbb37076758547de92cabf017843d.tar.bz2 |
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
Diffstat (limited to 'gcc/getpwd.c')
-rw-r--r-- | gcc/getpwd.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/gcc/getpwd.c b/gcc/getpwd.c index e48b277..6830c16 100644 --- a/gcc/getpwd.c +++ b/gcc/getpwd.c @@ -1,21 +1,14 @@ /* getpwd.c - get the working directory */ #include "config.h" - -#include <errno.h> -#include <sys/types.h> +#include "system.h" #include <sys/stat.h> -#ifndef errno -extern int errno; -#endif - /* Virtually every UN*X system now in common use (except for pre-4.3-tahoe BSD systems) now provides getcwd as called for by POSIX. Allow for the few exceptions to the general rule here. */ #if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD) -#include <sys/param.h> extern char *getwd (); #define getcwd(buf,len) getwd(buf) #ifdef MAXPATHLEN @@ -29,10 +22,9 @@ extern char *getcwd (); #define GUESSPATHLEN 100 #endif /* (defined (USG) || defined (VMS)) */ -char *getenv (); char *xmalloc (); -#ifndef VMS +#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN32__))) /* Get the working directory. Use the PWD environment variable if it's set correctly, since this is faster and gives more uniform answers @@ -80,7 +72,7 @@ getpwd () return p; } -#else /* VMS */ +#else /* VMS || _WIN32 && !__CYGWIN32__ */ #ifndef MAXPATHLEN #define MAXPATHLEN 255 @@ -91,8 +83,13 @@ getpwd () { static char *pwd = 0; - if (!pwd) pwd = getcwd (xmalloc (MAXPATHLEN+1), MAXPATHLEN+1); + if (!pwd) + pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1 +#ifdef VMS + , 0 +#endif + ); return pwd; } -#endif /* VMS */ +#endif /* VMS || _WIN32 && !__CYGWIN32__ */ |