diff options
| author | Lioncash <mathew1800@gmail.com> | 2014-12-05 20:54:41 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2014-12-05 20:55:29 -0500 |
| commit | 9bcadc8029b615d3d447a2a875fd720a73255d11 (patch) | |
| tree | 6812478b8ec5508dd2556c79f5a429a79c9910f9 /Source/Core/Common | |
| parent | f7a16eca84a868b5dcce113ece3e84d21347feae (diff) | |
Common: Remove locale based functions from CommonFuncs.
Since %f isn't used anymore in the shader generators, these can go.
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/CommonFuncs.h | 40 | ||||
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 2 |
2 files changed, 1 insertions, 41 deletions
diff --git a/Source/Core/Common/CommonFuncs.h b/Source/Core/Common/CommonFuncs.h index 91d24ec775..679975e76b 100644 --- a/Source/Core/Common/CommonFuncs.h +++ b/Source/Core/Common/CommonFuncs.h @@ -15,7 +15,6 @@ #include <libkern/OSByteOrder.h> #endif -#include <clocale> #include <cstddef> #include <type_traits> #include "Common/CommonTypes.h" @@ -109,45 +108,6 @@ inline u64 _rotr64(u64 x, unsigned int shift) #define snprintf _snprintf #define vscprintf _vscprintf -// Locale Cross-Compatibility - #define locale_t _locale_t - #define freelocale _free_locale - #define newlocale(mask, locale, base) _create_locale(mask, locale) - - #define LC_GLOBAL_LOCALE ((locale_t)-1) - #define LC_ALL_MASK LC_ALL - #define LC_COLLATE_MASK LC_COLLATE - #define LC_CTYPE_MASK LC_CTYPE - #define LC_MONETARY_MASK LC_MONETARY - #define LC_NUMERIC_MASK LC_NUMERIC - #define LC_TIME_MASK LC_TIME - - inline locale_t uselocale(locale_t new_locale) - { - // Retrieve the current per thread locale setting - bool bIsPerThread = (_configthreadlocale(0) == _ENABLE_PER_THREAD_LOCALE); - - // Retrieve the current thread-specific locale - locale_t old_locale = bIsPerThread ? _get_current_locale() : LC_GLOBAL_LOCALE; - - if (new_locale == LC_GLOBAL_LOCALE) - { - // Restore the global locale - _configthreadlocale(_DISABLE_PER_THREAD_LOCALE); - } - else if (new_locale != nullptr) - { - // Configure the thread to set the locale only for this thread - _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); - - // Set all locale categories - for (int i = LC_MIN; i <= LC_MAX; i++) - setlocale(i, new_locale->locinfo->lc_category[i].locale); - } - - return old_locale; - } - // 64 bit offsets for windows #define fseeko _fseeki64 #define ftello _ftelli64 diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index d1af64f30e..edc1ca9046 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -72,7 +72,7 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar // will be present in the middle of a multibyte sequence. // // This is why we lookup an ANSI (cp1252) locale here and use _vsnprintf_l. - static locale_t c_locale = nullptr; + static _locale_t c_locale = nullptr; if (!c_locale) c_locale = _create_locale(LC_ALL, ".1252"); writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args); |
