X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1678ad780265f08fc8b84d180c04ae3a9900b1bb..bd0df01f3f59940fdbca7a3472c256be2d034ab9:/src/common/file.cpp diff --git a/src/common/file.cpp b/src/common/file.cpp index 75fa377b7c..1e3734b5d6 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -102,6 +102,9 @@ #include #include +#ifndef MAX_PATH +#define MAX_PATH 512 +#endif // ============================================================================ // implementation of wxFile @@ -401,7 +404,12 @@ bool wxTempFile::Open(const wxString& strName) wxSplitPath(strName, &strPath, NULL, NULL); if ( strPath.IsEmpty() ) strPath = '.'; // GetTempFileName will fail if we give it empty string +#ifdef __WIN32__ if ( !GetTempFileName(strPath, "wx_",0, m_strTemp.GetWriteBuf(MAX_PATH)) ) +#else + // Not sure why MSVC++ 1.5 header defines first param as BYTE - bug? + if ( !GetTempFileName((BYTE) (const char*) strPath, "wx_",0, m_strTemp.GetWriteBuf(MAX_PATH)) ) +#endif wxLogLastError("GetTempFileName"); m_strTemp.UngetWriteBuf(); #endif // Windows/Unix