summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/runfile.in
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/runfile.in')
-rw-r--r--Build/source/utils/asymptote/runfile.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/runfile.in b/Build/source/utils/asymptote/runfile.in
index 872eb6fae4f..bde9407ff64 100644
--- a/Build/source/utils/asymptote/runfile.in
+++ b/Build/source/utils/asymptote/runfile.in
@@ -12,6 +12,10 @@ file* => primFile()
#include "triple.h"
#include "array.h"
+#ifdef __CYGWIN__
+extern "C" int mkstemp(char *c);
+#endif
+
using namespace camp;
using namespace settings;
using namespace vm;
@@ -346,3 +350,16 @@ Int rename(string from, string to)
cout << "Renamed " << from << " to " << to << endl;
return rc;
}
+
+// Create a unique temporary file name.
+string mktemp(string s)
+{
+ char *S=Strdup(s+"XXXXXX");
+ int fd=mkstemp(S);
+ if(fd < 0) {
+ ostringstream buf;
+ buf << "Could not create unique temporary filename based on " << s;
+ error(buf);
+ }
+ return S;
+}