From b31cfb8b87d7548c10b2b04b7298c753b0af1521 Mon Sep 17 00:00:00 2001 From: Sztergbaum Roman Date: Fri, 18 May 2018 21:46:34 +0200 Subject: fix compilation error on clang 6.0/APPLE (#3520) * fix compilation error on clang 6.0/APPLE * Update system.cpp --- toolsrc/src/vcpkg/base/system.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolsrc/src/vcpkg/base/system.cpp b/toolsrc/src/vcpkg/base/system.cpp index 4da4548af..73a92f2da 100644 --- a/toolsrc/src/vcpkg/base/system.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -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 canonicalPath(realpath(buf, NULL)); -- cgit v1.2.3