Fix std::optional related compilation errors on some platforms
This commit is contained in:
@@ -2549,7 +2549,7 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
|
||||
return FS_NORMAL;
|
||||
}
|
||||
|
||||
std::optional<std::string_view> NextString() override
|
||||
opt::optional<std::string_view> NextString() override
|
||||
{
|
||||
if (this->i >= TEXT_TAB_END) return std::nullopt;
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "gfx_type.h"
|
||||
#include "core/bitmath_func.hpp"
|
||||
#include "vehicle_type.h"
|
||||
#include "3rdparty/optional/ottd_optional.h"
|
||||
|
||||
/**
|
||||
* Extract the StringTab from a StringID.
|
||||
@@ -266,7 +267,7 @@ public:
|
||||
* Get the next string to search through.
|
||||
* @return The next string or nullopt if there is none.
|
||||
*/
|
||||
virtual std::optional<std::string_view> NextString() = 0;
|
||||
virtual opt::optional<std::string_view> NextString() = 0;
|
||||
|
||||
/**
|
||||
* Get the default (font) size of the string.
|
||||
|
@@ -194,7 +194,7 @@ void TextfileWindow::SetupScrollbars(bool force_reflow)
|
||||
return FS_MONO;
|
||||
}
|
||||
|
||||
/* virtual */ std::optional<std::string_view> TextfileWindow::NextString()
|
||||
/* virtual */ opt::optional<std::string_view> TextfileWindow::NextString()
|
||||
{
|
||||
if (this->search_iterator >= this->lines.size()) return std::nullopt;
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "strings_func.h"
|
||||
#include "textfile_type.h"
|
||||
#include "window_gui.h"
|
||||
#include "3rdparty/optional/ottd_optional.h"
|
||||
|
||||
const char *GetTextfile(TextfileType type, Subdirectory dir, const char *filename);
|
||||
|
||||
@@ -36,7 +37,7 @@ struct TextfileWindow : public Window, MissingGlyphSearcher {
|
||||
|
||||
void Reset() override;
|
||||
FontSize DefaultSize() override;
|
||||
std::optional<std::string_view> NextString() override;
|
||||
opt::optional<std::string_view> NextString() override;
|
||||
bool Monospace() override;
|
||||
void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override;
|
||||
|
||||
|
Reference in New Issue
Block a user