From: Václav Slavík Date: Sat, 15 Dec 2001 16:44:43 +0000 (+0000) Subject: Oops, Watcom doesn't have _mktemp in DOS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7070f55b2c7818d040065d8ccfbb5a90566e9900 Oops, Watcom doesn't have _mktemp in DOS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/filename.cpp b/src/common/filename.cpp index d1d0a43d76..ff25ddc377 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -468,8 +468,8 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix) #ifndef __WATCOMC__ ::DosCreateDir(wxStringBuffer(path, MAX_PATH), NULL); #endif - -#else // !Windows, !OS/2, !DOS + +#else // !Windows, !OS/2 if ( dir.empty() ) { dir = wxGetenv(_T("TMP")); @@ -499,19 +499,7 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix) path += name; -#if defined(__DOS__) && defined(__WATCOMC__) - // scratch space for mkstemp() - path += _T("XXXXXX"); - - // can use the cast here because the length doesn't change and the string - // is not shared - if ( !_mktemp((char *)path.mb_str()) ) - { - // this might be not necessary as mkstemp() on most systems should have - // already done it but it doesn't hurt neither... - path.clear(); - } -#elif defined(HAVE_MKSTEMP) +#if defined(HAVE_MKSTEMP) // scratch space for mkstemp() path += _T("XXXXXX"); @@ -534,9 +522,11 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix) { path.clear(); } -#else // !HAVE_MKTEMP +#else // !HAVE_MKTEMP (includes __DOS__) // generate the unique file name ourselves + #ifndef __DOS__ path << (unsigned int)getpid(); + #endif wxString pathTry;