Fix build with USE_ASAN=ON

Signed-off-by: Mateusz Tabaka <tab.debugteam@gmail.com>

https://github.com/intel/compute-runtime/pull/314

Change-Id: I2b699df3f158b961a1a329fb81de8cd7115d06bc
This commit is contained in:
8tab
2020-05-20 23:01:05 +02:00
committed by sys_ocldev
parent d291d61472
commit 7937da71f6
15 changed files with 40 additions and 17 deletions

View File

@@ -69,11 +69,14 @@ std::string getRunPath(char *argv0) {
res = res.substr(0, pos);
if (res == "." || pos == std::string::npos) {
char *cwd;
#if defined(__linux__)
res = getcwd(nullptr, 0);
cwd = getcwd(nullptr, 0);
#else
res = _getcwd(nullptr, 0);
cwd = _getcwd(nullptr, 0);
#endif
res = cwd;
free(cwd);
}
return res;