summaryrefslogtreecommitdiffstats
path: root/gcc/ada/cio.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/cio.c')
-rw-r--r--gcc/ada/cio.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c
index ac23519ae9b..fd85df96923 100644
--- a/gcc/ada/cio.c
+++ b/gcc/ada/cio.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2013, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -40,6 +40,9 @@
#include "adaint.h"
+/* We need L_tmpnam definition */
+#include <stdio.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -135,7 +138,18 @@ put_char_stderr (int c)
char *
mktemp (char *template)
{
+#if !(defined (__RTP__) || defined (VTHREADS))
+ static char buf[L_tmpnam]; /* Internal buffer for name */
+
+ /* If parameter is NULL use internal buffer */
+ if (template == NULL)
+ template = buf;
+
+ __gnat_tmp_name (template);
+ return template;
+#else
return tmpnam (NULL);
+#endif
}
#endif
OpenPOWER on IntegriCloud