fix compilation error on clang 6.0/APPLE (#3520)

* fix compilation error on clang 6.0/APPLE

* Update system.cpp
This commit is contained in:
Sztergbaum Roman 2018-05-18 21:46:34 +02:00 committed by Robert Schumacher
parent aad8cbb041
commit b31cfb8b87

View File

@ -40,8 +40,9 @@ namespace vcpkg::System
if (bytes == 0) std::abort();
return fs::path(buf, buf + bytes);
#elif defined(__APPLE__)
uint32_t size = 1024 * 32;
char buf[size] = {};
static constexpr const uint32_t buff_size = 1024 * 32;
uint32_t size = buff_size;
char buf[buff_size] = {};
bool result = _NSGetExecutablePath(buf, &size);
Checks::check_exit(VCPKG_LINE_INFO, result != -1, "Could not determine current executable path.");
std::unique_ptr<char> canonicalPath(realpath(buf, NULL));