aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-06-28 20:07:32 +0000
committerJeff Law <law@gcc.gnu.org>1998-06-28 14:07:32 -0600
commit39d45901b349d70579241a01327f7fb2d7f1973d (patch)
tree090fc13e4457409b9fd5f4c8b2fe0006c1e8ba1e /gcc/gcc.c
parentb0d45b7466551a15e6734144b03e13397af90a14 (diff)
downloadgcc-39d45901b349d70579241a01327f7fb2d7f1973d.zip
gcc-39d45901b349d70579241a01327f7fb2d7f1973d.tar.gz
gcc-39d45901b349d70579241a01327f7fb2d7f1973d.tar.bz2
choose-temp.c (choose_temp_base): Restore original variant of this function for compatibility.
* choose-temp.c (choose_temp_base): Restore original variant of this function for compatibility. (make_temp_file): This is the new, preferred interface to create temporary files. * collect2.c (choose_temp_base): Delete declaration. (make_temp_file): Declare. (temp_filename_length, temp_filename): Delete. (main): Use make_temp_file to get temporary files. Use --lang-c to force the resulting ctort/dtor file to be compiled with the C compiler. Make sure to remove temporary files on all exit paths. * gcc.c (make_temp_file): Provide prototype if MKTEMP_EACH_FILE is defined. (choose_temp_base): Only provide prototype if MKTEMP_EACH_FILE is not defined. (do_spec): Use make_temp_file if MKTEMP_EACH_FILE is defined. From-SVN: r20784
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cc4af8e..09b0332 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -121,7 +121,6 @@ static char dir_separator_str[] = {DIR_SEPARATOR, 0};
#define GET_ENVIRONMENT(ENV_VALUE,ENV_NAME) ENV_VALUE = getenv (ENV_NAME)
#endif
-extern char *choose_temp_base PROTO((void));
extern char *my_strerror PROTO((int));
#ifndef HAVE_KILL
@@ -1269,6 +1268,9 @@ static int argbuf_index;
#define MKTEMP_EACH_FILE
#ifdef MKTEMP_EACH_FILE
+
+extern char *make_temp_file PROTO((void));
+
/* This is the list of suffixes and codes (%g/%u/%U) and the associated
temp file. */
@@ -1280,8 +1282,11 @@ static struct temp_name {
int filename_length; /* strlen (filename). */
struct temp_name *next;
} *temp_names;
+#else
+extern char *choose_temp_base PROTO((void));
#endif
+
/* Number of commands executed so far. */
static int execution_count;
@@ -3512,7 +3517,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
t->length = p - suffix;
t->suffix = save_string (suffix, p - suffix);
t->unique = (c != 'g');
- temp_filename = choose_temp_base ();
+ temp_filename = make_temp_file ();
temp_filename_length = strlen (temp_filename);
t->filename = temp_filename;
t->filename_length = temp_filename_length;