Skip to content

Commit

Permalink
ooh, new clang-format version
Browse files Browse the repository at this point in the history
  • Loading branch information
strega-nil committed Mar 30, 2021
1 parent 34619df commit 98f640b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/tls12-download.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void __declspec(noreturn) abort_api_failure(const HANDLE std_out, const w

#ifndef NDEBUG
int main()
#else // ^^^ debug // !debug vvv
#else // ^^^ debug // !debug vvv
int __stdcall entry()
#endif // ^^^ !debug
{
Expand Down
20 changes: 10 additions & 10 deletions src/vcpkg/base/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ namespace vcpkg::Files

return fs::file_status(ft, permissions);

#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
auto result = follow_symlinks ? fs::stdfs::status(p, ec) : fs::stdfs::symlink_status(p, ec);
// libstdc++ doesn't correctly not-set ec on nonexistent paths
if (ec.value() == ENOENT || ec.value() == ENOTDIR)
Expand Down Expand Up @@ -410,7 +410,7 @@ namespace vcpkg::Files
}
ec.clear();
return;
#else // ^^^ defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM // !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM vvv
#else // ^^^ defined(_WIN32) && !VCPKG_USE_STD_FILESYSTEM // !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM vvv
return fs::stdfs::copy_symlink(oldpath, newpath, ec);
#endif // ^^^ !defined(_WIN32) || VCPKG_USE_STD_FILESYSTEM
}
Expand All @@ -433,7 +433,7 @@ namespace vcpkg::Files
{
ec.assign(GetLastError(), std::system_category());
}
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
struct stat s;
if (lstat(path.c_str(), &s))
{
Expand Down Expand Up @@ -912,7 +912,7 @@ namespace vcpkg::Files
auto written_bytes = sendfile(o_fd, i_fd, &bytes, info.st_size);
#elif defined(__APPLE__)
auto written_bytes = fcopyfile(i_fd, o_fd, 0, COPYFILE_ALL);
#else // ^^^ defined(__APPLE__) // !(defined(__APPLE__) || defined(__linux__)) vvv
#else // ^^^ defined(__APPLE__) // !(defined(__APPLE__) || defined(__linux__)) vvv
ssize_t written_bytes = 0;
{
constexpr std::size_t buffer_length = 4096;
Expand Down Expand Up @@ -1009,7 +1009,7 @@ namespace vcpkg::Files
{
ec.assign(GetLastError(), std::system_category());
}
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
if (rmdir(current_path.c_str()))
{
ec.assign(errno, std::system_category());
Expand Down Expand Up @@ -1038,7 +1038,7 @@ namespace vcpkg::Files
ec.assign(GetLastError(), std::system_category());
}
}
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
else
{
if (unlink(current_path.c_str()))
Expand Down Expand Up @@ -1188,7 +1188,7 @@ namespace vcpkg::Files
FILE* f = nullptr;
#if defined(_WIN32)
auto err = _wfopen_s(&f, file_path.native().c_str(), L"wb");
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
f = fopen(file_path.native().c_str(), "wb");
int err = f != nullptr ? 0 : 1;
#endif // ^^^ !defined(_WIN32)
Expand Down Expand Up @@ -1234,7 +1234,7 @@ namespace vcpkg::Files
#if defined(_WIN32)
// absolute was called system_complete in experimental filesystem
return fs::stdfs::system_complete(path, ec);
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
if (path.is_absolute())
{
return path;
Expand Down Expand Up @@ -1405,7 +1405,7 @@ namespace vcpkg::Files
{
#if defined(_WIN32)
static constexpr wchar_t const* EXTS[] = {L".cmd", L".exe", L".bat"};
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
static constexpr char const* EXTS[] = {""};
#endif // ^^^!defined(_WIN32)
auto paths = Strings::split_paths(System::get_environment_variable("PATH").value_or_exit(VCPKG_LINE_INFO));
Expand Down Expand Up @@ -1467,7 +1467,7 @@ namespace vcpkg::Files
{
return lhs / rhs;
}
#else // ^^^ unix // windows vvv
#else // ^^^ unix // windows vvv
auto rhs_root_directory = rhs.root_directory();
auto rhs_root_name = rhs.root_name();

Expand Down
6 changes: 3 additions & 3 deletions src/vcpkg/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace vcpkg
Checks::check_exit(VCPKG_LINE_INFO, sz2 + 1 == sz);
ret.pop_back();
return Strings::to_utf8(ret.c_str());
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
auto v = getenv(varname.c_str());
if (!v) return nullopt;
return std::string(v);
Expand All @@ -156,7 +156,7 @@ namespace vcpkg
}

Checks::check_exit(VCPKG_LINE_INFO, exit_code != 0);
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
if (auto v = value.get())
{
Checks::check_exit(VCPKG_LINE_INFO, setenv(varname.c_str(), v->c_str(), 1) == 0);
Expand Down Expand Up @@ -282,7 +282,7 @@ namespace vcpkg
ret.pop_back(); // remove extra trailing null byte
return Strings::to_utf8(ret);
}
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) / !defined(_WIN32) vvv
Optional<std::string> System::get_registry_string(void*, StringView, StringView) { return nullopt; }
#endif // defined(_WIN32)

Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/commands.integrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console
table.format("vcpkg integrate remove", "Remove user-wide integration");
table.format("vcpkg integrate project", "Generate a referencing nuget package for individual VS project use");
table.format("vcpkg integrate powershell", "Enable PowerShell tab-completion");
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
#else // ^^^ defined(_WIN32) // !defined(_WIN32) vvv
table.format("vcpkg integrate install", "Make installed packages available user-wide");
table.format("vcpkg integrate remove", "Remove user-wide integration");
table.format("vcpkg integrate bash", "Enable bash tab-completion");
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ namespace vcpkg::Metrics
if (request) WinHttpCloseHandle(request);
if (connect) WinHttpCloseHandle(connect);
if (session) WinHttpCloseHandle(session);
#else // ^^^ _WIN32 // !_WIN32 vvv
#else // ^^^ _WIN32 // !_WIN32 vvv
(void)payload;
#endif // ^^^ !_WIN32
}
Expand Down

0 comments on commit 98f640b

Please sign in to comment.