X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6a5705cfe86144c3c1e6b25b6ffcc38a4dd6ccb2..4562bb77645125f427751de0320774e5f0d92fba:/src/files.c diff --git a/src/files.c b/src/files.c index b69e2aa6..9fa9b4bb 100644 --- a/src/files.c +++ b/src/files.c @@ -41,7 +41,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "system.h" #include "files.h" -#include "new.h" +#include "alloc.h" #include "gram.h" FILE *finput = NULL; @@ -133,6 +133,15 @@ openfiles() strlwr (infile); #endif /* MSDOS */ +#if (defined(_WIN32) && !defined(__CYGWIN32__)) + tmp_base = getenv ("TEMP"); /* Windows95 defines this ... */ + if (tmp_base == 0) + tmp_base = getenv ("Temp"); /* ... while NT prefers this */ + if (tmp_base == 0) + tmp_base = ""; + strlwr (infile); +#endif /* _WIN32 && !__CYGWIN32__ */ + tmp_len = strlen (tmp_base); if (spec_outfile) @@ -263,13 +272,13 @@ openfiles() fdefines = tryopen(tmpdefsfile, "w+"); } -#ifndef MSDOS +#if !(defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__))) if (! noparserflag) unlink(actfile); unlink(tmpattrsfile); unlink(tmptabfile); unlink(tmpdefsfile); -#endif +#endif /* MSDOS || (_WIN32 && !__CYGWIN32__) */ /* These are opened by `done' or `open_extra_files', if at all */ if (spec_outfile) @@ -412,12 +421,12 @@ int k; if (k==0) sys$exit(SS$_NORMAL); sys$exit(SS$_ABORT); #else -#ifdef MSDOS +#if (defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__))) if (actfile && ! noparserflag) unlink(actfile); if (tmpattrsfile) unlink(tmpattrsfile); if (tmptabfile) unlink(tmptabfile); if (tmpdefsfile) unlink(tmpdefsfile); -#endif /* MSDOS */ +#endif /* MSDOS || (_WIN32 && !__CYGWIN32__) */ exit(k); #endif /* not VMS, or __VMS_POSIX */ }