Fix for CreateTempFileName with wxFFile for Windows. Also _open_osfhandle
requires O_BINARY on Borland, and the others don't seem to mind it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -619,7 +619,7 @@ static int wxOpenWithDeleteOnClose(const wxString& filename)
|
|||||||
HANDLE h = ::CreateFile(filename, access, 0, NULL,
|
HANDLE h = ::CreateFile(filename, access, 0, NULL,
|
||||||
disposition, attributes, NULL);
|
disposition, attributes, NULL);
|
||||||
|
|
||||||
return wxOpenOSFHandle(h, 0);
|
return wxOpenOSFHandle(h, wxO_BINARY);
|
||||||
}
|
}
|
||||||
#endif // wxOpenOSFHandle
|
#endif // wxOpenOSFHandle
|
||||||
|
|
||||||
@@ -649,7 +649,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose)
|
|||||||
return file->Open(path, _T("w+b"));
|
return file->Open(path, _T("w+b"));
|
||||||
#else // wx_fdopen
|
#else // wx_fdopen
|
||||||
int fd = wxTempOpen(path, deleteOnClose);
|
int fd = wxTempOpen(path, deleteOnClose);
|
||||||
if (fd != -1)
|
if (fd == -1)
|
||||||
return false;
|
return false;
|
||||||
file->Attach(wx_fdopen(fd, "w+b"));
|
file->Attach(wx_fdopen(fd, "w+b"));
|
||||||
return file->IsOpened();
|
return file->IsOpened();
|
||||||
|
|||||||
Reference in New Issue
Block a user