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:
parent
2fdb3a4a91
commit
0913e968f5
3 changed files with 46 additions and 45 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue