mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-29 13:45:35 +00:00
stratosphere: fix static constexpr member variable with incomplete type
GCC accepts this for some reason (because of the lambda?) but Clang correctly rejects this.
This commit is contained in:
parent
d787bec63e
commit
003d8508bb
1 changed files with 19 additions and 19 deletions
|
@ -71,7 +71,7 @@ namespace ams::settings {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<Language Lang>
|
template<Language Lang>
|
||||||
static constexpr inline LanguageCode EncodeLanguage = [] {
|
static constexpr inline LanguageCode EncodeLanguage() {
|
||||||
if constexpr (false) { /* ... */ }
|
if constexpr (false) { /* ... */ }
|
||||||
#define AMS_MATCH_LANGUAGE(lang, enc) else if constexpr (Lang == Language_##lang) { return LanguageCode::Encode(enc); }
|
#define AMS_MATCH_LANGUAGE(lang, enc) else if constexpr (Lang == Language_##lang) { return LanguageCode::Encode(enc); }
|
||||||
AMS_MATCH_LANGUAGE(Japanese, "ja")
|
AMS_MATCH_LANGUAGE(Japanese, "ja")
|
||||||
|
@ -94,28 +94,28 @@ namespace ams::settings {
|
||||||
AMS_MATCH_LANGUAGE(TraditionalChinese, "zh-Hant")
|
AMS_MATCH_LANGUAGE(TraditionalChinese, "zh-Hant")
|
||||||
#undef AMS_MATCH_LANGUAGE
|
#undef AMS_MATCH_LANGUAGE
|
||||||
else { static_assert(Lang != Language_Japanese); }
|
else { static_assert(Lang != Language_Japanese); }
|
||||||
}();
|
}
|
||||||
|
|
||||||
static constexpr inline LanguageCode Encode(const Language language) {
|
static constexpr inline LanguageCode Encode(const Language language) {
|
||||||
constexpr LanguageCode EncodedLanguages[Language_Count] = {
|
constexpr LanguageCode EncodedLanguages[Language_Count] = {
|
||||||
EncodeLanguage<Language_Japanese>,
|
EncodeLanguage<Language_Japanese>(),
|
||||||
EncodeLanguage<Language_AmericanEnglish>,
|
EncodeLanguage<Language_AmericanEnglish>(),
|
||||||
EncodeLanguage<Language_French>,
|
EncodeLanguage<Language_French>(),
|
||||||
EncodeLanguage<Language_German>,
|
EncodeLanguage<Language_German>(),
|
||||||
EncodeLanguage<Language_Italian>,
|
EncodeLanguage<Language_Italian>(),
|
||||||
EncodeLanguage<Language_Spanish>,
|
EncodeLanguage<Language_Spanish>(),
|
||||||
EncodeLanguage<Language_Chinese>,
|
EncodeLanguage<Language_Chinese>(),
|
||||||
EncodeLanguage<Language_Korean>,
|
EncodeLanguage<Language_Korean>(),
|
||||||
EncodeLanguage<Language_Dutch>,
|
EncodeLanguage<Language_Dutch>(),
|
||||||
EncodeLanguage<Language_Portuguese>,
|
EncodeLanguage<Language_Portuguese>(),
|
||||||
EncodeLanguage<Language_Russian>,
|
EncodeLanguage<Language_Russian>(),
|
||||||
EncodeLanguage<Language_Taiwanese>,
|
EncodeLanguage<Language_Taiwanese>(),
|
||||||
EncodeLanguage<Language_BritishEnglish>,
|
EncodeLanguage<Language_BritishEnglish>(),
|
||||||
EncodeLanguage<Language_CanadianFrench>,
|
EncodeLanguage<Language_CanadianFrench>(),
|
||||||
EncodeLanguage<Language_LatinAmericanSpanish>,
|
EncodeLanguage<Language_LatinAmericanSpanish>(),
|
||||||
/* 4.0.0+ */
|
/* 4.0.0+ */
|
||||||
EncodeLanguage<Language_SimplifiedChinese>,
|
EncodeLanguage<Language_SimplifiedChinese>(),
|
||||||
EncodeLanguage<Language_TraditionalChinese>,
|
EncodeLanguage<Language_TraditionalChinese>(),
|
||||||
};
|
};
|
||||||
return EncodedLanguages[language];
|
return EncodedLanguages[language];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue