aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJose Ruiz <ruiz@adacore.com>2008-08-01 10:34:50 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-01 10:34:50 +0200
commitbd56b3fca70f2a9f277274847268a9b835f2a740 (patch)
tree2d226c4f53e822950834b72227597ef0adbc59ce /gcc
parent7273484240a419f9a7101062712515091583185d (diff)
downloadgcc-bd56b3fca70f2a9f277274847268a9b835f2a740.zip
gcc-bd56b3fca70f2a9f277274847268a9b835f2a740.tar.gz
gcc-bd56b3fca70f2a9f277274847268a9b835f2a740.tar.bz2
adaint.c (__gnat_tmp_name): Refine the generation of temporary names for RTX.
2008-08-01 Jose Ruiz <ruiz@adacore.com> * adaint.c (__gnat_tmp_name): Refine the generation of temporary names for RTX. Adding a suffix that is incremented at each iteration. From-SVN: r138482
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/adaint.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index c131357..03a0ff4 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -983,8 +983,12 @@ void
__gnat_tmp_name (char *tmp_filename)
{
#ifdef RTX
- /* RTX in RTSS mode does not support tempnam nor tmpnam */
- strcpy (tmp_filename, "c:\\WINDOWS\\Temp\\gnat-XXXXXX");
+ /* Variable used to create a series of unique names */
+ static int counter = 0;
+
+ /* RTX in RTSS mode does not support tempnam nor tmpnam so we emulate it */
+ strcpy (tmp_filename, "c:\\WINDOWS\\Temp\\gnat-");
+ sprintf (&tmp_filename[strlen (tmp_filename)], "%d\0", counter++);
#elif defined (__MINGW32__)
{