Skip to content

Commit 1b5d5a7

Browse files
committed
FIXME: std::format for some reason refuses to work in macos CI.
1 parent b2aef6c commit 1b5d5a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Source/Managers/FrameMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ int FrameMan::SaveBitmap(SaveBitmapMode modeToSave, const std::string& nameBase,
452452
}
453453

454454
// TODO: Remove this once GCC13 is released and switched to. std::format and std::chrono::time_zone are not part of latest libstdc++.
455-
#if defined(__GNUC__) && __GNUC__ < 13
455+
#if defined(__GNUC__) && (__GNUC__ < 13 || defined(__APPLE__)) //FIXME: macOS for some reason builds with incorrect iconv in CI which breaks format, could not debug.
456456
std::chrono::time_point now = std::chrono::system_clock::now();
457457
time_t currentTime = std::chrono::system_clock::to_time_t(now);
458458
tm* localCurrentTime = std::localtime(&currentTime);

Source/Menus/SettingsVideoGUI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using namespace RTE;
2626

2727
std::string SettingsVideoGUI::PresetResolutionRecord::GetDisplayString() const {
28-
#if __cpp_lib_format >= 201907L
28+
#if __cpp_lib_format >= 201907L && !(defined(__APPLE__) && defined(__GNUC__)) //FIXME: macOS CI borken without this.
2929
return std::format("{}x{} ({:.1g}x Fullscreen scale)", Width, Height, Scale);
3030
#else
3131
return std::to_string(Width) + "x" + std::to_string(Height);
@@ -113,7 +113,7 @@ void SettingsVideoGUI::CreateCustomResolutionBox() {
113113

114114
m_CustomResolutionMultiplierComboBox = dynamic_cast<GUIComboBox*>(m_GUIControlManager->GetControl("ComboboxResolutionMultiplier"));
115115
PopulateResMultplierComboBox();
116-
#if __cpp_lib_format >= 201907L
116+
#if __cpp_lib_format >= 201907L && !(defined(__APPLE__) && defined(__GNUC__))
117117
m_CustomResolutionMultiplierComboBox->SetText(std::format("{:.3g}x", m_NewResMultiplier));
118118
#else
119119
m_CustomResolutionMultiplierComboBox->SetText(std::to_string(m_NewResMultiplier));
@@ -131,7 +131,7 @@ void SettingsVideoGUI::SetEnabled(bool enable) const {
131131
if (enable) {
132132
m_CustomResolutionWidthTextBox->SetText(std::to_string(static_cast<int>(g_WindowMan.GetResX())));
133133
m_CustomResolutionHeightTextBox->SetText(std::to_string(static_cast<int>(g_WindowMan.GetResY())));
134-
#if __cpp_lib_format >= 201907L
134+
#if __cpp_lib_format >= 201907L && !(defined(__APPLE__) && defined(__GNUC__))
135135
m_CustomResolutionMultiplierComboBox->SetText(std::format("{:.3g}x", m_NewResMultiplier));
136136
#else
137137
m_CustomResolutionMultiplierComboBox->SetText(std::to_string(m_NewResMultiplier));
@@ -200,7 +200,7 @@ void SettingsVideoGUI::PopulateResMultplierComboBox() {
200200
m_CustomResolutionMultiplierComboBox->ClearList();
201201

202202
for (float resMultiplier = 1.0f; resMultiplier <= maximumResMultiplier; resMultiplier += 0.5) {
203-
#if __cpp_lib_format >= 201907L
203+
#if __cpp_lib_format >= 201907L && !(defined(__APPLE__) && defined(__GNUC__))
204204
m_CustomResolutionMultiplierComboBox->AddItem(std::format("{:.3g}x", resMultiplier));
205205
#else
206206
m_CustomResolutionMultiplierComboBox->AddItem(std::to_string(resMultiplier));

0 commit comments

Comments
 (0)