Apply clang-format across the whole tree
Run clang-format (the repo's .clang-format: LLVM base, 120 cols, tabs, Allman functions) over every source file so the tree is formatter-clean. Whitespace only -- no behavior change; full x64 + x86 suites pass. Also set SortIncludes: false in .clang-format. Windows include order is load-bearing (windows.h must precede tlhelp32.h / mmreg.h / xinput.h / dinput.h; winsock2.h must precede windows.h), and the default alphabetical sort reorders tlhelp32.h ahead of windows.h -- a build break. Leaving order alone keeps the manual, correct grouping.
This commit is contained in:
@@ -9,8 +9,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace coop
|
||||
{
|
||||
namespace coop {
|
||||
|
||||
// Directory of the current executable, with a trailing separator.
|
||||
inline std::wstring exe_directory()
|
||||
@@ -28,21 +27,17 @@ inline std::wstring exe_directory()
|
||||
inline std::wstring deployed_artifact_path(const wchar_t* name)
|
||||
{
|
||||
const std::wstring here = exe_directory() + name;
|
||||
if (GetFileAttributesW(here.c_str()) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
if (GetFileAttributesW(here.c_str()) != INVALID_FILE_ATTRIBUTES) {
|
||||
return here;
|
||||
}
|
||||
std::wstring dir = exe_directory();
|
||||
if (!dir.empty())
|
||||
{
|
||||
if (!dir.empty()) {
|
||||
dir.pop_back(); // drop the trailing separator before going up a level
|
||||
}
|
||||
const std::size_t slash = dir.find_last_of(L"\\/");
|
||||
if (slash != std::wstring::npos)
|
||||
{
|
||||
if (slash != std::wstring::npos) {
|
||||
const std::wstring up = dir.substr(0, slash + 1) + name;
|
||||
if (GetFileAttributesW(up.c_str()) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
if (GetFileAttributesW(up.c_str()) != INVALID_FILE_ATTRIBUTES) {
|
||||
return up;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user