Reintroduce LanguageCode alias type

This commit is contained in:
lynxnb 2021-09-27 18:36:37 +02:00 committed by ◱ Mark
parent c6d91c552b
commit afc3dda1ee

View File

@ -8,6 +8,8 @@
#include <common/macros.h> #include <common/macros.h>
namespace skyline { namespace skyline {
using LanguageCode = u64;
namespace constant { namespace constant {
constexpr size_t OldLanguageCodeListSize{15}; //!< The size of the pre 4.0.0 language code list constexpr size_t OldLanguageCodeListSize{15}; //!< The size of the pre 4.0.0 language code list
constexpr size_t NewLanguageCodeListSize{18}; //!< The size of the post 10.1.0 language code list (was 17 between 4.0.0 - 10.1.0) constexpr size_t NewLanguageCodeListSize{18}; //!< The size of the post 10.1.0 language code list (was 17 between 4.0.0 - 10.1.0)
@ -70,13 +72,13 @@ namespace skyline {
#undef MAP #undef MAP
#undef DONT_MAP #undef DONT_MAP
constexpr std::array<u64, constant::NewLanguageCodeListSize> LanguageCodeList{ constexpr std::array<LanguageCode, constant::NewLanguageCodeListSize> LanguageCodeList{
#define LANG_ENTRY(lang, code, sysIndex, appIndex, map) util::MakeMagic<u64>(#code), #define LANG_ENTRY(lang, code, sysIndex, appIndex, map) util::MakeMagic<LanguageCode>(#code),
LANGUAGES LANGUAGES
#undef LANG_ENTRY #undef LANG_ENTRY
}; };
constexpr u64 GetLanguageCode(SystemLanguage language) { constexpr LanguageCode GetLanguageCode(SystemLanguage language) {
return LanguageCodeList.at(static_cast<size_t>(language)); return LanguageCodeList.at(static_cast<size_t>(language));
} }