Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ jobs:
include:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# while GitHub has larger macOS runners, they are not available for our repos :(
- os_version: "13"
os_name: "macos"
- os_version: "14"
os_name: "macos"
- os_version: "15"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ jobs:
include:
- name: Linux-AppImage
coverage: true
- name: Homebrew-macos-13
coverage: false
- name: Homebrew-macos-14
coverage: false
- name: Homebrew-macos-15
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ LizardByte has the full documentation hosted on [Read the Docs](https://docs.liz
<td>Windows: 10+ (Windows Server does not support virtual gamepads)</td>
</tr>
<tr>
<td>macOS: 13+</td>
<td>macOS: 14+</td>
</tr>
<tr>
<td>Linux/Debian: 12+ (bookworm)</td>
<td>Linux/Debian: 13+ (trixie)</td>
</tr>
<tr>
<td>Linux/Fedora: 40+</td>
<td>Linux/Fedora: 41+</td>
</tr>
<tr>
<td>Linux/Ubuntu: 22.04+ (jammy)</td>
Expand Down
14 changes: 14 additions & 0 deletions packaging/sunshine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class @PROJECT_NAME@ < Formula
depends_on "opus"
depends_on "icu4c" => :recommended

on_macos do
depends_on xcode: ["15.3", :build]
end

on_linux do
depends_on "avahi"
depends_on "libayatana-appindicator"
Expand All @@ -59,6 +63,16 @@ class @PROJECT_NAME@ < Formula
depends_on "wayland"
end

fails_with :clang do
build 1400
cause "Requires C++23 support"
end

fails_with :gcc do
version "12" # fails with GCC 12.x and earlier
cause "Requires C++23 support"
end

def install
ENV["BRANCH"] = "@GITHUB_BRANCH@"
ENV["BUILD_VERSION"] = "@BUILD_VERSION@"
Expand Down
5 changes: 3 additions & 2 deletions src/confighttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// standard includes
#include <filesystem>
#include <format>
#include <fstream>
#include <set>

Expand Down Expand Up @@ -713,7 +714,7 @@ namespace confighttp {
if (const int max_index = static_cast<int>(apps_node.size()) - 1; max_index < 0) {
error = "No applications to delete";
} else {
error = "'index' out of range, max index is "s + std::to_string(max_index);
error = std::format("'index' {} out of range, max index is {}", index, max_index);
}
bad_request(response, request, error);
return;
Expand All @@ -730,7 +731,7 @@ namespace confighttp {
proc::refresh(config::stream.file_apps);

output_tree["status"] = true;
output_tree["result"] = "application " + std::to_string(index) + " deleted";
output_tree["result"] = std::format("application {} deleted", index);
send_response(response, output_tree);
} catch (std::exception &e) {
BOOST_LOG(warning) << "DeleteApp: "sv << e.what();
Expand Down
13 changes: 6 additions & 7 deletions src/entry_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
// standard includes
#include <csignal>
#include <format>
#include <iostream>
#include <thread>

Expand All @@ -25,13 +26,11 @@ extern "C" {

using namespace std::literals;

void launch_ui() {
std::string url = "https://localhost:" + std::to_string(net::map_port(confighttp::PORT_HTTPS));
platf::open_url(url);
}

void launch_ui_with_path(std::string path) {
std::string url = "https://localhost:" + std::to_string(net::map_port(confighttp::PORT_HTTPS)) + path;
void launch_ui(const std::optional<std::string> &path) {
std::string url = std::format("https://localhost:{}", static_cast<int>(net::map_port(confighttp::PORT_HTTPS)));
if (path) {
url += *path;
}
platf::open_url(url);
}

Expand Down
12 changes: 3 additions & 9 deletions src/entry_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,13 @@

/**
* @brief Launch the Web UI.
* @param path Optional path to append to the base URL.
* @examples
* launch_ui();
* launch_ui("/pin");
* @examples_end
*/
void launch_ui();

/**
* @brief Launch the Web UI at a specific endpoint.
* @examples
* launch_ui_with_path("/pin");
* @examples_end
*/
void launch_ui_with_path(std::string path);
void launch_ui(const std::optional<std::string> &path = std::nullopt);

/**
* @brief Functions for handling command line arguments.
Expand Down
7 changes: 5 additions & 2 deletions src/nvenc/nvenc_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
// this include
#include "nvenc_base.h"

// standard includes
#include <format>

// local includes
#include "src/config.h"
#include "src/logging.h"
Expand Down Expand Up @@ -427,7 +430,7 @@ namespace nvenc {
extra += " two-pass";
}
if (config.vbv_percentage_increase > 0 && get_encoder_cap(NV_ENC_CAPS_SUPPORT_CUSTOM_VBV_BUF_SIZE)) {
extra += " vbv+" + std::to_string(config.vbv_percentage_increase);
extra += std::format(" vbv+{}", config.vbv_percentage_increase);
}
if (encoder_params.rfi) {
extra += " rfi";
Expand All @@ -439,7 +442,7 @@ namespace nvenc {
extra += " spatial-aq";
}
if (enc_config.rcParams.enableMinQP) {
extra += " qpmin=" + std::to_string(enc_config.rcParams.minQP.qpInterP);
extra += std::format(" qpmin={}", enc_config.rcParams.minQP.qpInterP);
}
if (config.insert_filler_data) {
extra += " filler-data";
Expand Down
23 changes: 20 additions & 3 deletions src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

// standard includes
#include <filesystem>
#include <format>
#include <string>
#include <utility>

Expand Down Expand Up @@ -636,7 +637,7 @@ namespace nvhttp {
tree.put("root.<xmlattr>.status_code", 400);
tree.put(
"root.<xmlattr>.status_message",
"Pin must be 4 digits, " + std::to_string(pin.size()) + " provided"
std::format("Pin must be 4 digits, {} provided", pin.size())
);
return false;
}
Expand Down Expand Up @@ -896,7 +897,15 @@ namespace nvhttp {
}

tree.put("root.<xmlattr>.status_code", 200);
tree.put("root.sessionUrl0", launch_session->rtsp_url_scheme + net::addr_to_url_escaped_string(request->local_endpoint().address()) + ':' + std::to_string(net::map_port(rtsp_stream::RTSP_SETUP_PORT)));
tree.put(
"root.sessionUrl0",
std::format(
"{}{}:{}",
launch_session->rtsp_url_scheme,
net::addr_to_url_escaped_string(request->local_endpoint().address()),
static_cast<int>(net::map_port(rtsp_stream::RTSP_SETUP_PORT))
)
);
tree.put("root.gamesession", 1);

rtsp_stream::launch_session_raise(launch_session);
Expand Down Expand Up @@ -978,7 +987,15 @@ namespace nvhttp {
}

tree.put("root.<xmlattr>.status_code", 200);
tree.put("root.sessionUrl0", launch_session->rtsp_url_scheme + net::addr_to_url_escaped_string(request->local_endpoint().address()) + ':' + std::to_string(net::map_port(rtsp_stream::RTSP_SETUP_PORT)));
tree.put(
"root.sessionUrl0",
std::format(
"{}{}:{}",
launch_session->rtsp_url_scheme,
net::addr_to_url_escaped_string(request->local_endpoint().address()),
static_cast<int>(net::map_port(rtsp_stream::RTSP_SETUP_PORT))
)
);
tree.put("root.resume", 1);

rtsp_stream::launch_session_raise(launch_session);
Expand Down
3 changes: 2 additions & 1 deletion src/platform/linux/vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
// standard includes
#include <fcntl.h>
#include <format>
#include <sstream>
#include <string>

Expand Down Expand Up @@ -574,7 +575,7 @@ namespace va {
if (!display) {
char string[1024];

auto bytes = readlink(("/proc/self/fd/" + std::to_string(fd)).c_str(), string, sizeof(string));
auto bytes = readlink(std::format("/proc/self/fd/{}", fd).c_str(), string, sizeof(string));

std::string_view render_device {string, (std::size_t) bytes};

Expand Down
8 changes: 5 additions & 3 deletions src/platform/windows/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*/
#define INITGUID

// standard includes
#include <format>

// platform includes
#include <Audioclient.h>
#include <avrt.h>
Expand Down Expand Up @@ -168,8 +171,7 @@ namespace {
waveformat.SubFormat == KSDATAFORMAT_SUBTYPE_PCM ? "S" :
"UNKNOWN";

result += std::to_string(waveformat.Samples.wValidBitsPerSample) + " " +
std::to_string(waveformat.Format.nSamplesPerSec) + " ";
result += std::format("{} {} ", static_cast<int>(waveformat.Samples.wValidBitsPerSample), static_cast<int>(waveformat.Format.nSamplesPerSec));

switch (waveformat.dwChannelMask) {
case waveformat_mask_stereo:
Expand All @@ -189,7 +191,7 @@ namespace {
break;

default:
result += std::to_string(waveformat.Format.nChannels) + " channels (unrecognized)";
result += std::format("{} channels (unrecognized)", static_cast<int>(waveformat.Format.nChannels));
break;
}

Expand Down
3 changes: 2 additions & 1 deletion src/rtsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern "C" {
// standard includes
#include <array>
#include <cctype>
#include <format>
#include <set>
#include <unordered_map>
#include <utility>
Expand Down Expand Up @@ -864,7 +865,7 @@ namespace rtsp_stream {
session_option.next = &port_option;

// Moonlight merely requires 'server_port=<port>'
auto port_value = "server_port=" + std::to_string(port);
auto port_value = std::format("server_port={}", static_cast<int>(port));

port_option.option = const_cast<char *>("Transport");
port_option.content = port_value.data();
Expand Down
2 changes: 1 addition & 1 deletion src/system_tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ namespace system_tray {
tray.notification_icon = TRAY_ICON_LOCKED;
tray.tooltip = PROJECT_NAME;
tray.notification_cb = []() {
launch_ui_with_path("/pin");
launch_ui("/pin");
};
tray_update(&tray);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_display_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
#include "../tests_common.h"

#include <format>
#include <src/config.h>
#include <src/display_device.h>
#include <src/rtsp.h>
Expand Down Expand Up @@ -473,7 +474,7 @@ namespace {
} else {
const auto [manual_res] = std::get<manual_value_t<res_t>>(input_res);
video_config.dd.resolution_option = manual;
video_config.dd.manual_resolution = std::to_string(manual_res.m_width) + "x"s + std::to_string(manual_res.m_height);
video_config.dd.manual_resolution = std::format("{}x{}", static_cast<int>(manual_res.m_width), static_cast<int>(manual_res.m_height));
}
}

Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test_file_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
#include "../tests_common.h"

#include <format>
#include <src/file_handler.h>

struct FileHandlerParentDirectoryTest: testing::TestWithParam<std::tuple<std::string, std::string>> {};
Expand Down Expand Up @@ -79,13 +80,13 @@ Hey, hey, hey!

TEST_P(FileHandlerTests, WriteFileTest) {
auto [fileNum, content] = GetParam();
std::string fileName = "write_file_test_" + std::to_string(fileNum) + ".txt";
const std::string fileName = std::format("write_file_test_{}.txt", fileNum);
EXPECT_EQ(file_handler::write_file(fileName.c_str(), content), 0);
}

TEST_P(FileHandlerTests, ReadFileTest) {
auto [fileNum, content] = GetParam();
std::string fileName = "write_file_test_" + std::to_string(fileNum) + ".txt";
const std::string fileName = std::format("write_file_test_{}.txt", fileNum);
EXPECT_EQ(file_handler::read_file(fileName.c_str()), content);
}

Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../tests_common.h"
#include "../tests_log_checker.h"

#include <format>
#include <random>
#include <src/logging.h>

Expand Down Expand Up @@ -39,7 +40,7 @@ TEST_P(LogLevelsTest, PutMessage) {

std::random_device rand_dev;
std::mt19937_64 rand_gen(rand_dev());
auto test_message = std::to_string(rand_gen()) + std::to_string(rand_gen());
auto test_message = std::format("{}{}", rand_gen(), rand_gen());
BOOST_LOG(logger) << test_message;

ASSERT_TRUE(log_checker::line_contains(log_file, test_message));
Expand Down
3 changes: 2 additions & 1 deletion tools/sunshinesvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @brief Handles launching Sunshine.exe into user sessions as SYSTEM
*/
#define WIN32_LEAN_AND_MEAN
#include <format>
#include <string>
#include <Windows.h>
#include <WtsApi32.h>
Expand Down Expand Up @@ -137,7 +138,7 @@ bool RunTerminationHelper(HANDLE console_token, DWORD pid) {
command += L'"';
command += module_path;
command += L'"';
command += L" --terminate " + std::to_wstring(pid);
command += std::format(L" --terminate {}", pid);

STARTUPINFOW startup_info = {};
startup_info.cb = sizeof(startup_info);
Expand Down
Loading