3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

More win32/abc fixes

This commit is contained in:
Clifford Wolf 2014-10-12 14:48:19 +02:00
parent 2fdb3a4a91
commit 0913e968f5
3 changed files with 46 additions and 45 deletions

View file

@ -473,12 +473,14 @@ std::string proc_self_dirname()
#elif defined(_WIN32)
std::string proc_self_dirname()
{
char path[MAX_PATH+1];
if (!GetModuleFileName(0, path, MAX_PATH+1))
char longpath[MAX_PATH+1], shortpath[MAX_PATH+1];
if (!GetModuleFileName(0, longpath, MAX_PATH+1))
log_error("GetModuleFileName() failed.\n");
for (int i = strlen(path)-1; i >= 0 && path[i] != '/' && path[i] != '\\' ; i--)
path[i] = 0;
return std::string(path);
if (!GetShortPathName(longpath, shortpath, MAX_PATH+1))
log_error("GetShortPathName() failed.\n");
for (int i = strlen(shortpath)-1; i >= 0 && shortpath[i] != '/' && shortpath[i] != '\\' ; i--)
shortpath[i] = 0;
return std::string(shortpath);
}
#elif defined(EMSCRIPTEN)
std::string proc_self_dirname()