3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-05-25 11:26:22 +00:00

Fix Windows portability issues that break MSVC build.

This commit is contained in:
Catherine 2026-05-23 03:58:12 +00:00
parent b206c16347
commit ed263d26cc
3 changed files with 7 additions and 20 deletions

View file

@ -155,19 +155,13 @@ std::string get_base_tmpdir()
}
#if defined(_WIN32)
# ifdef __MINGW32__
char longpath[MAX_PATH + 1];
char shortpath[MAX_PATH + 1];
# else
WCHAR longpath[MAX_PATH + 1];
TCHAR shortpath[MAX_PATH + 1];
# endif
if (!GetTempPath(MAX_PATH+1, longpath))
if (!GetTempPathA(MAX_PATH+1, longpath))
log_error("GetTempPath() failed.\n");
if (!GetShortPathName(longpath, shortpath, MAX_PATH + 1))
if (!GetShortPathNameA(longpath, shortpath, MAX_PATH + 1))
log_error("GetShortPathName() failed.\n");
for (int i = 0; shortpath[i]; i++)
tmpdir += char(shortpath[i]);
tmpdir += shortpath;
#else
char * var = std::getenv("TMPDIR");
if (var && strlen(var)!=0) {