OSDN Git Service

* gcc.c (DELETE_IF_ORDINARY): New macro default definition.
authorrupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Apr 2004 15:28:42 +0000 (15:28 +0000)
committerrupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Apr 2004 15:28:42 +0000 (15:28 +0000)
(delete_if_ordinary): Use above macro.
* config/alpha/xm-vms.h (DELETE_IF_ORDINARY): New macro VMS definition.
Update copyright.
* doc/hostconfig.texi (DELETE_IF_ORDINARY): Document new macro.
* libiberty/mkstemps.c (mkstemps) [VMS]: Remove special open option.
 Update copyright.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81290 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/xm-vms.h
gcc/doc/hostconfig.texi
gcc/gcc.c
libiberty/ChangeLog
libiberty/mkstemps.c

index 9630090..68ee9a5 100644 (file)
@@ -1,3 +1,11 @@
+2004-04-29  Douglas B Rupp  <rupp@gnat.com>
+
+       * gcc.c (DELETE_IF_ORDINARY): New macro default definition.
+       (delete_if_ordinary): Use above macro.
+       * config/alpha/xm-vms.h (DELETE_IF_ORDINARY): New macro VMS definition.
+       Update copyright.
+       * doc/hostconfig.texi (DELETE_IF_ORDINARY): Document new macro.
+
 2004-04-29  Richard Earnshaw  <rearnsha@arm.com>
 
        * c-decl.c (get_parm_info): Use the correct tag keywords when
 2004-04-29  Richard Earnshaw  <rearnsha@arm.com>
 
        * c-decl.c (get_parm_info): Use the correct tag keywords when
index bdac52e..cf18b2f 100644 (file)
@@ -1,5 +1,5 @@
 /* Configuration for GNU C-compiler for openVMS/Alpha.
 /* Configuration for GNU C-compiler for openVMS/Alpha.
-   Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2001, 2004 Free Software Foundation, Inc.
    Contributed by Klaus Kaempf (kkaempf@progis.de).
 
 This file is part of GCC.
    Contributed by Klaus Kaempf (kkaempf@progis.de).
 
 This file is part of GCC.
@@ -43,3 +43,15 @@ Boston, MA 02111-1307, USA.  */
 #define HOST_OBJECT_SUFFIX ".obj"
 
 #define DUMPFILE_FORMAT "_%02d_"
 #define HOST_OBJECT_SUFFIX ".obj"
 
 #define DUMPFILE_FORMAT "_%02d_"
+
+#define DELETE_IF_ORDINARY(NAME,ST,VERBOSE_FLAG)           \
+do                                                         \
+  {                                                        \
+    while (stat (NAME, &ST) >= 0 && S_ISREG (ST.st_mode))  \
+      if (unlink (NAME) < 0)                               \
+       {                                                  \
+         if (VERBOSE_FLAG)                                \
+           perror_with_name (NAME);                       \
+         break;                                           \
+       }                                                  \
+  } while (0)
index e5387e1..c97b41b 100644 (file)
@@ -147,6 +147,15 @@ unique to each dump file kind, e.g. @samp{rtl}.
 
 If you do not define this macro, GCC will use @samp{.%02d.}.  You should
 define this macro if using the default will create an invalid file name.
 
 If you do not define this macro, GCC will use @samp{.%02d.}.  You should
 define this macro if using the default will create an invalid file name.
+
+@item DELETE_IF_ORDINARY
+Define this macro to be a C statement (sans semicolon) that performs
+host-dependent removal of ordinary temp files in the compilation driver.
+
+If you do not define this macro, GCC will use the default version. You
+should define this macro if the default version does not reliably remove
+the temp file as, for example, on VMS which allows multiple versions
+of a file.
 @end ftable
 
 @node Host Misc
 @end ftable
 
 @node Host Misc
index 4e4f93b..4434e79 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2245,6 +2245,17 @@ record_temp_file (const char *filename, int always_delete, int fail_delete)
 
 /* Delete all the temporary files whose names we previously recorded.  */
 
 
 /* Delete all the temporary files whose names we previously recorded.  */
 
+#ifndef DELETE_IF_ORDINARY
+#define DELETE_IF_ORDINARY(NAME,ST,VERBOSE_FLAG)        \
+do                                                      \
+  {                                                     \
+    if (stat (NAME, &ST) >= 0 && S_ISREG (ST.st_mode))  \
+      if (unlink (NAME) < 0)                            \
+       if (VERBOSE_FLAG)                               \
+         perror_with_name (NAME);                      \
+  } while (0)
+#endif
+
 static void
 delete_if_ordinary (const char *name)
 {
 static void
 delete_if_ordinary (const char *name)
 {
@@ -2261,10 +2272,7 @@ delete_if_ordinary (const char *name)
 
   if (i == 'y' || i == 'Y')
 #endif /* DEBUG */
 
   if (i == 'y' || i == 'Y')
 #endif /* DEBUG */
-    if (stat (name, &st) >= 0 && S_ISREG (st.st_mode))
-      if (unlink (name) < 0)
-       if (verbose_flag)
-         perror_with_name (name);
+  DELETE_IF_ORDINARY (name, st, verbose_flag);
 }
 
 static void
 }
 
 static void
index 553d17c..82547e2 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-29  Douglas B Rupp  <rupp@gnat.com>
+
+       * mkstemps.c (mkstemps) [VMS]: Remove special open option. Update
+       copyright.
+
 2004-04-26  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
 
        * configure.ac (UNSIGNED_64BIT_TYPE): Unquote the definition.
 2004-04-26  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
 
        * configure.ac (UNSIGNED_64BIT_TYPE): Unquote the definition.
index 1f6600a..94edf78 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1998, 2004 Free Software Foundation, Inc.
    This file is derived from mkstemp.c from the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    This file is derived from mkstemp.c from the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -121,11 +121,7 @@ mkstemps (template, suffix_len)
       v /= 62;
       XXXXXX[5] = letters[v % 62];
 
       v /= 62;
       XXXXXX[5] = letters[v % 62];
 
-#ifdef VMS
-      fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd");
-#else
       fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600);
       fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600);
-#endif
       if (fd >= 0)
        /* The file does not exist.  */
        return fd;
       if (fd >= 0)
        /* The file does not exist.  */
        return fd;