@@ -33,19 +33,19 @@ void OpenFile::set_path(OwningPtr<char> &&path, std::size_t bytes) {
33
33
static int openfile_mkstemp (IoErrorHandler &handler) {
34
34
#ifdef _WIN32
35
35
const unsigned int uUnique{0 };
36
- // GetTempFileNameW needs a directory name < MAX_PATH-14 characters in length.
37
- // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew
38
- wchar_t tempDirName[MAX_PATH - 14 ];
39
- wchar_t tempFileName[MAX_PATH];
36
+ // GetTempFileNameA needs a directory name < MAX_PATH-14 characters in length.
37
+ // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamea
38
+ char tempDirName[MAX_PATH - 14 ];
39
+ char tempFileName[MAX_PATH];
40
40
unsigned long nBufferLength{sizeof (tempDirName)};
41
- nBufferLength = ::GetTempPathW (nBufferLength, tempDirName);
41
+ nBufferLength = ::GetTempPathA (nBufferLength, tempDirName);
42
42
if (nBufferLength > sizeof (tempDirName) || nBufferLength == 0 ) {
43
43
return -1 ;
44
44
}
45
- if (::GetTempFileNameW (tempDirName, L " Fortran" , uUnique, tempFileName) == 0 ) {
45
+ if (::GetTempFileNameA (tempDirName, " Fortran" , uUnique, tempFileName) == 0 ) {
46
46
return -1 ;
47
47
}
48
- int fd{::_wopen (tempFileName, _O_CREAT | _O_BINARY | _O_TEMPORARY | _O_RDWR,
48
+ int fd{::_open (tempFileName, _O_CREAT | _O_BINARY | _O_TEMPORARY | _O_RDWR,
49
49
_S_IREAD | _S_IWRITE)};
50
50
#else
51
51
char path[]{" /tmp/Fortran-Scratch-XXXXXX" };
0 commit comments