Author: faridz
Date: Tue Oct 28 11:05:53 2008
New Revision: 708626
URL: http://svn.apache.org/viewvc?rev=708626&view=rev
Log:
2008-10-28 Farid Zaripov <[EMAIL PROTECTED]>
* tests/src/file.cpp: #define P_tmpdir with a different
value on Windows.
(rw_tmpnam) [_WIN32]: Added definition of the tmpdir,
initialized by value of TMP instead of TMPDIR.
Modified:
stdcxx/branches/4.2.x/tests/src/file.cpp
Modified: stdcxx/branches/4.2.x/tests/src/file.cpp
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/src/file.cpp?rev=708626&r1=708625&r2=708626&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/src/file.cpp (original)
+++ stdcxx/branches/4.2.x/tests/src/file.cpp Tue Oct 28 11:05:53 2008
@@ -70,10 +70,14 @@
#endif
#ifndef P_tmpdir
- // P_tmpdir is an XSI (X/Open System Interfaces) extension
- // to POSIX which need not be provided by otherwise conforming
- // implementations
-# define P_tmpdir "/tmp/"
+# ifndef _WIN32
+ // P_tmpdir is an XSI (X/Open System Interfaces) extension
+ // to POSIX which need not be provided by otherwise conforming
+ // implementations
+# define P_tmpdir "/tmp/"
+# else // _WIN32
+# define P_tmpdir "\\"
+# endif // _WIN32
#endif
#ifndef _RWSTD_NO_PURE_C_HEADERS
@@ -209,9 +213,8 @@
# define TMP_TEMPLATE "tmpfile-XXXXXX"
const char *tmpdir = getenv ("TMPDIR");
- if (tmpdir == NULL) {
+ if (!tmpdir)
tmpdir = P_tmpdir;
- }
if (!buf) {
static char fname_buf [PATH_MAX];
@@ -255,6 +258,10 @@
# ifdef _WIN32
+ const char *tmpdir = getenv ("TMP");
+ if (!tmpdir)
+ tmpdir = P_tmpdir;
+
// create a temporary file name
char* fname = tempnam (tmpdir, ".rwtest-tmp");