refactor: reorganize includes and move candidateSocketPaths to anonymous namespace
This commit is contained in:
@@ -2,25 +2,28 @@
|
|||||||
#include "StardustBridge.hpp"
|
#include "StardustBridge.hpp"
|
||||||
#include "ModelCache.hpp"
|
#include "ModelCache.hpp"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <cstring>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
static std::vector<std::string> candidateSocketPaths() {
|
namespace {
|
||||||
|
|
||||||
|
std::vector<std::string> candidateSocketPaths() {
|
||||||
std::vector<std::string> out;
|
std::vector<std::string> out;
|
||||||
|
|
||||||
if (const char* envSock = std::getenv("STARDUSTXR_SOCKET")) out.emplace_back(envSock);
|
if (const char* envSock = std::getenv("STARDUSTXR_SOCKET")) out.emplace_back(envSock);
|
||||||
@@ -60,6 +63,8 @@ static std::vector<std::string> candidateSocketPaths() {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
std::string StardustBridge::defaultSocketPath() {
|
std::string StardustBridge::defaultSocketPath() {
|
||||||
auto c = candidateSocketPaths();
|
auto c = candidateSocketPaths();
|
||||||
return c.empty() ? std::string{} : c.front();
|
return c.empty() ? std::string{} : c.front();
|
||||||
|
|||||||
Reference in New Issue
Block a user