diff options
author | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-05-28 02:18:52 +0000 |
commit | c59fe5fe4739f0c61560f05d4e42b4e552219b27 (patch) | |
tree | 8cf79e85e394b3177a28d374415840a4e0a025ad /Build/source/utils/asymptote/runfile.in | |
parent | 771db15706dbf3f4af8b630dcb15646a3e5fda00 (diff) |
asy 2.10
git-svn-id: svn://tug.org/texlive/trunk@22633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/runfile.in')
-rw-r--r-- | Build/source/utils/asymptote/runfile.in | 17 |
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; +} |