From 1153e4cefbee7d59a659344e709a3a223bb6aa87 Mon Sep 17 00:00:00 2001 From: Tarek Mahmoud Sayed Date: Tue, 23 Aug 2016 11:23:19 -0700 Subject: [PATCH] Enable more code under globalization for netcore This fix is to enable the code handling LCID for Windows in globalization namespace --- clr.coreclr.props | 1 + src/classlibnative/inc/nlsinfo.h | 2 - src/classlibnative/nls/nlsinfo.cpp | 6 - .../src/System/Globalization/CultureData.cs | 134 ++------------------- .../src/System/Globalization/CultureInfo.cs | 2 - .../src/System/Globalization/NumberFormatInfo.cs | 8 -- src/mscorlib/src/System/Globalization/STUBS.cs | 19 --- src/mscorlib/src/System/Globalization/TextInfo.cs | 2 - src/vm/ecalllist.h | 4 - src/vm/mscorlib.h | 12 +- src/vm/object.h | 23 ++-- 11 files changed, 27 insertions(+), 186 deletions(-) diff --git a/clr.coreclr.props b/clr.coreclr.props index 23a1652..d7f6421 100644 --- a/clr.coreclr.props +++ b/clr.coreclr.props @@ -98,6 +98,7 @@ + true true diff --git a/src/classlibnative/inc/nlsinfo.h b/src/classlibnative/inc/nlsinfo.h index b09ed5d..8f868a8 100644 --- a/src/classlibnative/inc/nlsinfo.h +++ b/src/classlibnative/inc/nlsinfo.h @@ -101,10 +101,8 @@ public: // static FCDECL1(FC_BOOL_RET, nativeInitCultureData, CultureDataBaseObject *data); static FCDECL3(FC_BOOL_RET, nativeGetNumberFormatInfoValues, StringObject* localeNameUNSAFE, NumberFormatInfo* nfi, CLR_BOOL useUserOverride); -#ifdef FEATURE_USE_LCID static FCDECL1(Object*, LCIDToLocaleName, LCID lcid); static FCDECL1(INT32, LocaleNameToLCID, StringObject* localeNameUNSAFE); -#endif // FEATURE_USE_LCID static INT32 QCALLTYPE InternalCompareString (INT_PTR handle, INT_PTR handleOrigin, LPCWSTR localeName, LPCWSTR string1, INT32 offset1, INT32 length1, LPCWSTR string2, INT32 offset2, INT32 length2, INT32 flags); static INT32 QCALLTYPE InternalGetGlobalizedHashCode(INT_PTR handle, INT_PTR handleOrigin, LPCWSTR localeName, LPCWSTR pString, INT32 length, INT32 dwFlagsIn, BOOL bForceRandomizedHashing, INT64 additionalEntropy); diff --git a/src/classlibnative/nls/nlsinfo.cpp b/src/classlibnative/nls/nlsinfo.cpp index babad22..da54a5b 100644 --- a/src/classlibnative/nls/nlsinfo.cpp +++ b/src/classlibnative/nls/nlsinfo.cpp @@ -796,7 +796,6 @@ BOOL COMNlsInfo::CallGetLocaleInfoEx(LPCWSTR localeName, int lcType, STRINGREF* return (result != 0); } -#ifdef FEATURE_USE_LCID FCIMPL1(Object*, COMNlsInfo::LCIDToLocaleName, LCID lcid) { FCALL_CONTRACT; @@ -849,7 +848,6 @@ FCIMPL1(INT32, COMNlsInfo::LocaleNameToLCID, StringObject* localeNameUNSAFE) return result; } FCIMPLEND -#endif // FEATURE_USE_LCID //////////////////////////////////////////////////////////////////////// // @@ -1007,10 +1005,8 @@ FCIMPL3(FC_BOOL_RET, COMNlsInfo::nativeGetNumberFormatInfoValues, _ASSERT(ret == TRUE); ret &= CallGetLocaleInfoEx(pLocaleName, LOCALE_INEGNUMBER| LOCALE_RETURN_NUMBER , &(gc.numfmt->cNegativeNumberFormat), useUserOverride); _ASSERT(ret == TRUE); -#ifndef FEATURE_CORECLR ret &= CallGetLocaleInfoEx(pLocaleName, LOCALE_IDIGITSUBSTITUTION | LOCALE_RETURN_NUMBER, &(gc.numfmt->iDigitSubstitution), useUserOverride); _ASSERT(ret == TRUE); -#endif // LOCALE_SNATIVEDIGITS (gc.tempArray of strings) if (GetNativeDigitsFromWin32(pLocaleName, &gc.tempArray, useUserOverride)) { @@ -2880,10 +2876,8 @@ FCIMPL1(FC_BOOL_RET, COMNlsInfo::nativeInitCultureData, CultureDataBaseObject *c // Remember our neutrality gc.cultureData->bNeutral = (bNeutral != 0); -#ifndef FEATURE_CORECLR gc.cultureData->bWin32Installed = (IsOSValidLocaleName(buffer, gc.cultureData->bNeutral) != 0); gc.cultureData->bFramework = (IsWhidbeyFrameworkCulture(buffer) != 0); -#endif // FEATURE_CORECLR // Note: Parents will be set dynamically diff --git a/src/mscorlib/src/System/Globalization/CultureData.cs b/src/mscorlib/src/System/Globalization/CultureData.cs index 5ca27fe..ae1eeea 100644 --- a/src/mscorlib/src/System/Globalization/CultureData.cs +++ b/src/mscorlib/src/System/Globalization/CultureData.cs @@ -159,8 +159,6 @@ namespace System.Globalization private String sCompareInfo; // Compare info name (including sorting key) to use if custom private String sScripts; // Typical Scripts for this locale (latn;cyrl; etc) - // CoreCLR depends on this even though its not exposed publicly. -#if !FEATURE_CORECLR private int iDefaultAnsiCodePage = undef; // default ansi code page ID (ACP) private int iDefaultOemCodePage = undef; // default oem code page ID (OCP or OEM) private int iDefaultMacCodePage = undef; // default macintosh code page @@ -176,15 +174,12 @@ namespace System.Globalization private String sConsoleFallbackName; // The culture name for the console fallback UI culture private String sKeyboardsToInstall; // Keyboard installation string. private String fontSignature; // Font signature (16 WORDS) -#endif // The bools all need to be in one spot private bool bUseOverrides; // use user overrides? private bool bNeutral; // Flags for the culture (ie: neutral or not right now) -#if !FEATURE_CORECLR private bool bWin32Installed; // Flags indicate if the culture is Win32 installed private bool bFramework; // Flags for indicate if the culture is one of Whidbey cultures -#endif // Region Name to Culture Name mapping table // (In future would be nice to be in registry or something) @@ -347,7 +342,6 @@ namespace System.Globalization // Make a new culturedata CultureData invariant = new CultureData(); -#if !FEATURE_CORECLR // Call the native code to get the value of bWin32Installed. // For versions <= Vista, we set this to false for compatibility with v2. // For Windows 7, the flag is true. @@ -356,7 +350,6 @@ namespace System.Globalization // Ask the native code to fill it out for us, we only need the field IsWin32Installed nativeInitCultureData(invariant); -#endif // Basics // Note that we override the resources since this IS NOT supposed to change (by definition) @@ -368,10 +361,8 @@ namespace System.Globalization invariant.sName = ""; // locale name (ie: en-us) invariant.sParent = ""; // Parent name (which may be a custom locale/culture) invariant.bNeutral = false; // Flags for the culture (ie: neutral or not right now) -#if !FEATURE_CORECLR // Don't set invariant.bWin32Installed, we used nativeInitCultureData for that. invariant.bFramework = true; -#endif invariant.sEnglishDisplayName = "Invariant Language (Invariant Country)"; // English pretty name for this locale invariant.sNativeDisplayName = "Invariant Language (Invariant Country)"; // Native pretty name for this locale @@ -455,8 +446,6 @@ namespace System.Globalization invariant.sCompareInfo = ""; // Compare info name (including sorting key) to use if custom invariant.sScripts = "Latn;"; // Typical Scripts for this locale (latn,cyrl, etc) - // These are desktop only, not coreclr - #if !FEATURE_CORECLR invariant.iLanguage = 0x007f; // locale ID (0409) - NO sort information invariant.iDefaultAnsiCodePage = 1252; // default ansi code page ID (ACP) invariant.iDefaultOemCodePage = 437; // default oem code page ID (OCP or OEM) @@ -469,7 +458,6 @@ namespace System.Globalization invariant.iInputLanguageHandle = 0x007f; // input language handle invariant.sConsoleFallbackName = ""; // The culture name for the console fallback UI culture invariant.sKeyboardsToInstall = "0409:00000409"; // Keyboard installation string. - #endif // Remember it s_Invariant = invariant; } @@ -929,10 +917,8 @@ namespace System.Globalization internal static void ClearCachedData() { s_cachedCultures = null; -#if !FEATURE_CORECLR s_cachedRegions = null; s_replacementCultureNames = null; -#endif } [System.Security.SecuritySafeCritical] // auto-generated @@ -1023,7 +1009,6 @@ namespace System.Globalization } } -#if !FEATURE_CORECLR internal bool IsReplacementCulture { get @@ -1062,7 +1047,6 @@ namespace System.Globalization } return Array.BinarySearch(replacementCultureNames, name) >= 0; } -#endif //////////////////////////////////////////////////////////////////////// // @@ -1326,7 +1310,6 @@ namespace System.Globalization } } -#if !FEATURE_CORECLR // iso 639 language name, ie: eng internal String SISO639LANGNAME2 { @@ -1354,7 +1337,6 @@ namespace System.Globalization return this.sAbbrevLang; } } -#endif // Localized name for this language (Windows Only) ie: Inglis // This is only valid for Windows 8 and higher neutrals: @@ -1445,7 +1427,6 @@ namespace System.Globalization } // (user can override) country code (RegionInfo) -#if !FEATURE_CORECLR internal int ICOUNTRY { get @@ -1453,7 +1434,6 @@ namespace System.Globalization return DoGetLocaleInfoInt(LOCALE_ICOUNTRY); } } -#endif // GeoId internal int IGEOID @@ -1543,7 +1523,6 @@ namespace System.Globalization } } -#if !FEATURE_CORECLR // ISO 3166 Country Name internal String SISO3166CTRYNAME2 { @@ -1572,7 +1551,6 @@ namespace System.Globalization } } -#if !FEATURE_CORECLR // Default Country private int IDEFAULTCOUNTRY { @@ -1581,7 +1559,6 @@ namespace System.Globalization return DoGetLocaleInfoInt(LOCALE_IDEFAULTCOUNTRY); } } -#endif // Console fallback name (ie: locale to use for console apps for unicode-only locales) internal int IINPUTLANGUAGEHANDLE @@ -1622,7 +1599,6 @@ namespace System.Globalization return this.sConsoleFallbackName; } } -#endif ///////////// // Numbers // @@ -1635,7 +1611,6 @@ namespace System.Globalization // internal int iDigits ; // (user can override) number of fractional digits // internal int iNegativeNumber ; // (user can override) negative number format -#if !FEATURE_CORECLR // Leading zeroes private bool ILEADINGZEROS { @@ -1644,7 +1619,6 @@ namespace System.Globalization return (DoGetLocaleInfoInt(LOCALE_ILZERO) == 1); } } -#endif // (user can override) grouping of digits @@ -1653,11 +1627,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.waGrouping == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.waGrouping == null || UseUserOverride) { this.waGrouping = ConvertWin32GroupString(DoGetLocaleInfo(LOCALE_SGROUPING)); } @@ -1784,11 +1754,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.sCurrency == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.sCurrency == null || UseUserOverride) { this.sCurrency = DoGetLocaleInfo(LOCALE_SCURRENCY); } @@ -1848,11 +1814,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.waMonetaryGrouping == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.waMonetaryGrouping == null || UseUserOverride) { this.waMonetaryGrouping = ConvertWin32GroupString(DoGetLocaleInfo(LOCALE_SMONGROUPING)); } @@ -1872,11 +1834,7 @@ namespace System.Globalization { get { - if (this.iMeasure == undef -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.iMeasure == undef || UseUserOverride) { this.iMeasure = DoGetLocaleInfoInt(LOCALE_IMEASURE); } @@ -1890,11 +1848,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.sListSeparator == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.sListSeparator == null || UseUserOverride) { this.sListSeparator = DoGetLocaleInfo(LOCALE_SLIST); } @@ -1902,7 +1856,6 @@ namespace System.Globalization } } -#if !FEATURE_CORECLR // Paper size private int IPAPERSIZE { @@ -1911,7 +1864,6 @@ namespace System.Globalization return DoGetLocaleInfoInt(LOCALE_IPAPERSIZE); } } -#endif //////////////////////////// // Calendar/Time (Gregorian) // @@ -1923,11 +1875,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.sAM1159 == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.sAM1159 == null || UseUserOverride) { this.sAM1159 = DoGetLocaleInfo(LOCALE_S1159); } @@ -1941,11 +1889,7 @@ namespace System.Globalization [System.Security.SecurityCritical] // auto-generated get { - if (this.sPM2359 == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.sPM2359 == null || UseUserOverride) { this.sPM2359 = DoGetLocaleInfo(LOCALE_S2359); } @@ -1958,11 +1902,7 @@ namespace System.Globalization { get { - if (this.saLongTimes == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.saLongTimes == null || UseUserOverride) { String[] longTimes = DoEnumTimeFormats(); if (longTimes == null || longTimes.Length == 0) @@ -1984,11 +1924,7 @@ namespace System.Globalization { get { - if (this.saShortTimes == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.saShortTimes == null || UseUserOverride) { // Try to get the short times from the OS/culture.dll String[] shortTimes = DoEnumShortTimeFormats(); @@ -2148,11 +2084,7 @@ namespace System.Globalization { get { - if (this.iFirstDayOfWeek == undef -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.iFirstDayOfWeek == undef || UseUserOverride) { // Have to convert it from windows to .Net formats this.iFirstDayOfWeek = ConvertFirstDayOfWeekMonToSun(DoGetLocaleInfoInt(LOCALE_IFIRSTDAYOFWEEK)); @@ -2166,11 +2098,7 @@ namespace System.Globalization { get { - if (this.iFirstWeekOfYear == undef -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (this.iFirstWeekOfYear == undef || UseUserOverride) { this.iFirstWeekOfYear = DoGetLocaleInfoInt(LOCALE_IFIRSTWEEKOFYEAR); } @@ -2361,11 +2289,7 @@ namespace System.Globalization // right after we insert the newly created CalendarData (below) CalendarData calendarData = calendars[calendarIndex]; // Make sure that calendar has data - if (calendarData == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (calendarData == null || UseUserOverride) { Contract.Assert(this.sWindowsName != null, "[CultureData.GetCalendar] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); calendarData = new CalendarData(this.sWindowsName, calendarId, this.UseUserOverride); @@ -2437,17 +2361,9 @@ namespace System.Globalization // es-ES_tradnl -> es-ES internal String STEXTINFO // Text info name to use for text information { -#if !FEATURE_CORECLR [System.Security.SecuritySafeCritical] -#endif get { -#if FEATURE_CORECLR - // Note: Custom cultures might point at another culture's textinfo, however windows knows how - // to redirect it to the desired textinfo culture, so this is OK. - Contract.Assert(this.sWindowsName != null, "[CultureData.STEXTINFO] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); - return (this.sWindowsName); -#else if (this.sTextInfo == null) { // LOCALE_SSORTLOCALE is broken in Win7 for Alt sorts. @@ -2465,24 +2381,15 @@ namespace System.Globalization } return this.sTextInfo; -#endif } } // Compare info name (including sorting key) to use if custom internal String SCOMPAREINFO { -#if !FEATURE_CORECLR [System.Security.SecuritySafeCritical] -#endif get { -#if FEATURE_CORECLR - // Note: Custom cultures might point at another culture's compareinfo, however windows knows how - // to redirect it to the desired compareinfo culture, so this is OK. - Contract.Assert(this.sWindowsName != null, "[CultureData.SCOMPAREINFO] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); - return (this.sWindowsName); -#else if (this.sCompareInfo == null) { // LOCALE_SSORTLOCALE is broken in Win7 for Alt sorts. @@ -2501,7 +2408,6 @@ namespace System.Globalization } return this.sCompareInfo; -#endif } } @@ -2509,15 +2415,10 @@ namespace System.Globalization { get { -#if FEATURE_CORECLR - return false; -#else return IsCustomCultureId(this.ILANGUAGE); -#endif } } -#if !FEATURE_CORECLR // Typical Scripts for this locale (latn;cyrl; etc) private String SSCRIPTS @@ -2564,9 +2465,7 @@ namespace System.Globalization } } -#endif -#if !FEATURE_CORECLR internal int IDEFAULTANSICODEPAGE // default ansi code page ID (ACP) { get @@ -2645,7 +2544,6 @@ namespace System.Globalization { get { return this.bFramework; } } -#endif // !FEATURE_CORECLR //////////////////// // Derived properties // @@ -2715,11 +2613,7 @@ namespace System.Globalization [System.Security.SecuritySafeCritical] // auto-generated get { - if (sTimeSeparator == null -#if !FEATURE_CORECLR - || UseUserOverride -#endif - ) + if (sTimeSeparator == null || UseUserOverride) { string longTimeFormat = ReescapeWin32String(DoGetLocaleInfo(LOCALE_STIMEFORMAT)); if (String.IsNullOrEmpty(longTimeFormat)) @@ -3089,10 +2983,8 @@ namespace System.Globalization nfi.positiveSign = this.sPositiveSign; nfi.negativeSign = this.sNegativeSign; -#if !FEATURE_CORECLR nfi.nativeDigits = this.saNativeDigits; nfi.digitSubstitution = this.iDigitSubstitution; -#endif // !FEATURE_CORECLR nfi.numberGroupSeparator = this.sThousandSeparator; nfi.numberDecimalSeparator = this.sDecimalSeparator; diff --git a/src/mscorlib/src/System/Globalization/CultureInfo.cs b/src/mscorlib/src/System/Globalization/CultureInfo.cs index 994093b..dd6867c 100644 --- a/src/mscorlib/src/System/Globalization/CultureInfo.cs +++ b/src/mscorlib/src/System/Globalization/CultureInfo.cs @@ -73,12 +73,10 @@ namespace System.Globalization { internal NumberFormatInfo numInfo; internal DateTimeFormatInfo dateTimeInfo; internal Calendar calendar; -#if !FEATURE_CORECLR [OptionalField(VersionAdded = 1)] internal int m_dataItem; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) [OptionalField(VersionAdded = 1)] internal int cultureID = 0x007f; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) -#endif // !FEATURE_CORECLR // // The CultureData instance that we are going to read data from. // For supported culture, this will be the CultureData instance that read data from mscorlib assembly. diff --git a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs b/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs index ffa1185..fae91c2 100644 --- a/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs +++ b/src/mscorlib/src/System/Globalization/NumberFormatInfo.cs @@ -92,10 +92,8 @@ namespace System.Globalization { internal int percentNegativePattern = 0; internal int percentDecimalDigits = 2; -#if !FEATURE_CORECLR [OptionalField(VersionAdded = 2)] internal int digitSubstitution = 1; // DigitShapes.None -#endif // !FEATURE_CORECLR internal bool isReadOnly=false; // We shouldn't be persisting m_useUserOverride (since its useless & we weren't using it), @@ -111,7 +109,6 @@ namespace System.Globalization { } #region Serialization -#if !FEATURE_CORECLR // Check if NumberFormatInfo was not set up ambiguously for parsing as number and currency // eg. if the NumberDecimalSeparator and the NumberGroupSeparator were the same. This check // is solely for backwards compatibility / version tolerant serialization @@ -119,7 +116,6 @@ namespace System.Globalization { internal bool validForParseAsNumber = true; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) [OptionalField(VersionAdded = 1)] internal bool validForParseAsCurrency = true; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) -#endif // !FEATURE_CORECLR [OnSerializing] private void OnSerializing(StreamingContext ctx) @@ -219,7 +215,6 @@ namespace System.Globalization { } } -#if !FEATURE_CORECLR static private void VerifyDigitSubstitution(DigitShapes digitSub, String propertyName) { switch(digitSub) { @@ -233,7 +228,6 @@ namespace System.Globalization { throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDigitSubstitution"), propertyName); } } -#endif // !FEATURE_CORECLR // We aren't persisting dataItem any more (since its useless & we weren't using it), // Ditto with m_useUserOverride. Don't use them, we use a local copy of everything. @@ -776,7 +770,6 @@ namespace System.Globalization { } } -#if !FEATURE_CORECLR [System.Runtime.InteropServices.ComVisible(false)] public DigitShapes DigitSubstitution { @@ -788,7 +781,6 @@ namespace System.Globalization { digitSubstitution = (int)value; } } -#endif // !FEATURE_CORECLR public Object GetFormat(Type formatType) { return formatType == typeof(NumberFormatInfo)? this: null; diff --git a/src/mscorlib/src/System/Globalization/STUBS.cs b/src/mscorlib/src/System/Globalization/STUBS.cs index 59bb114..d8aa1f0 100644 --- a/src/mscorlib/src/System/Globalization/STUBS.cs +++ b/src/mscorlib/src/System/Globalization/STUBS.cs @@ -1,21 +1,10 @@ namespace System.Globalization { - public partial class CompareInfo : System.Runtime.Serialization.IDeserializationCallback - { - public int LCID { get { throw new NotImplementedException(); } } - public static System.Globalization.CompareInfo GetCompareInfo(int culture) { throw new NotImplementedException(); } - public static System.Globalization.CompareInfo GetCompareInfo(int culture, System.Reflection.Assembly assembly) { throw new NotImplementedException(); } - } - public partial class CultureInfo : System.ICloneable, System.IFormatProvider { - public CultureInfo(int culture) { throw new NotImplementedException(); } - public CultureInfo(int culture, bool useUserOverride) { throw new NotImplementedException(); } - public virtual int LCID { get { throw new NotImplementedException(); } } public virtual string ThreeLetterISOLanguageName { get { throw new NotImplementedException(); } } public virtual string ThreeLetterWindowsLanguageName { get { throw new NotImplementedException(); } } public static System.Globalization.CultureInfo CreateSpecificCulture(string name) { throw new NotImplementedException(); } - public static System.Globalization.CultureInfo GetCultureInfo(int culture) { throw new NotImplementedException(); } public static System.Globalization.CultureInfo GetCultureInfoByIetfLanguageTag(string name) { throw new NotImplementedException(); } public static System.Globalization.CultureInfo[] GetCultures(System.Globalization.CultureTypes types) { throw new NotImplementedException(); } } @@ -34,15 +23,8 @@ namespace System.Globalization public String TimeSeparator { set { throw null; } } }*/ - public sealed partial class NumberFormatInfo : System.ICloneable, System.IFormatProvider - { - [System.Runtime.InteropServices.ComVisibleAttribute(false)] - public System.Globalization.DigitShapes DigitSubstitution { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } - } - public partial class RegionInfo { - public RegionInfo(int culture) { throw new NotImplementedException(); } public virtual string ThreeLetterISORegionName { get { throw new NotImplementedException(); } } public virtual string ThreeLetterWindowsRegionName { get { throw new NotImplementedException(); } } } @@ -69,7 +51,6 @@ namespace System.Globalization public virtual int ANSICodePage { get { throw new NotImplementedException(); } } public virtual int EBCDICCodePage { get { throw new NotImplementedException(); } } [System.Runtime.InteropServices.ComVisibleAttribute(false)] - public int LCID { get { throw new NotImplementedException(); } } public virtual int MacCodePage { get { throw new NotImplementedException(); } } public virtual int OEMCodePage { get { throw new NotImplementedException(); } } public string ToTitleCase(string str) { throw new NotImplementedException(); } diff --git a/src/mscorlib/src/System/Globalization/TextInfo.cs b/src/mscorlib/src/System/Globalization/TextInfo.cs index ef5b85c..ccdeef0 100644 --- a/src/mscorlib/src/System/Globalization/TextInfo.cs +++ b/src/mscorlib/src/System/Globalization/TextInfo.cs @@ -121,7 +121,6 @@ namespace System.Globalization { [OptionalField(VersionAdded = 2)] private string customCultureName; -#if !FEATURE_CORECLR // the following fields are defined to keep compatibility with Everett. // don't change/remove the names/types of these fields. [OptionalField(VersionAdded = 1)] @@ -130,7 +129,6 @@ namespace System.Globalization { internal bool m_useUserOverride; [OptionalField(VersionAdded = 1)] internal int m_win32LangID; -#endif // !FEATURE_CORECLR [OnDeserializing] diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index c8375d5..17011e8 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -400,9 +400,7 @@ FCFuncStart(gSystem_RuntimeType) #if defined(FEATURE_COMINTEROP) FCFuncElement("GetTypeFromCLSIDImpl", ReflectionInvocation::GetClassFromCLSID) FCFuncElement("GetTypeFromProgIDImpl", ReflectionInvocation::GetClassFromProgID) -#if !defined(FEATURE_CORECLR) FCFuncElement("InvokeDispMethod", ReflectionInvocation::InvokeDispMethod) -#endif #ifdef FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION FCFuncElement("IsTypeExportedToWindowsRuntime", RuntimeTypeHandle::IsTypeExportedToWindowsRuntime) #endif @@ -1469,10 +1467,8 @@ FCFuncStart(gCultureDataFuncs) FCFuncElement("nativeInitCultureData", COMNlsInfo::nativeInitCultureData) FCFuncElement("nativeGetNumberFormatInfoValues", COMNlsInfo::nativeGetNumberFormatInfoValues) FCFuncElement("nativeEnumTimeFormats", CalendarData::nativeEnumTimeFormats) -#ifdef FEATURE_USE_LCID FCFuncElement("LCIDToLocaleName", COMNlsInfo::LCIDToLocaleName) FCFuncElement("LocaleNameToLCID", COMNlsInfo::LocaleNameToLCID) -#endif // FEATURE_USE_LCID QCFuncElement("nativeEnumCultureNames", COMNlsInfo::nativeEnumCultureNames) diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h index 6134af7..291c6ab 100644 --- a/src/vm/mscorlib.h +++ b/src/vm/mscorlib.h @@ -554,18 +554,14 @@ DEFINE_FIELD_U(iFirstDayOfWeek, CultureDataBaseObject, iFirstDayOfWeek) DEFINE_FIELD_U(iFirstWeekOfYear, CultureDataBaseObject, iFirstWeekOfYear) DEFINE_FIELD_U(waCalendars, CultureDataBaseObject, waCalendars) DEFINE_FIELD_U(calendars, CultureDataBaseObject, calendars) -#ifndef FEATURE_CORECLR DEFINE_FIELD_U(iReadingLayout, CultureDataBaseObject, iReadingLayout) -#endif DEFINE_FIELD_U(sTextInfo, CultureDataBaseObject, sTextInfo) DEFINE_FIELD_U(sCompareInfo, CultureDataBaseObject, sCompareInfo) DEFINE_FIELD_U(sScripts, CultureDataBaseObject, sScripts) DEFINE_FIELD_U(bUseOverrides, CultureDataBaseObject, bUseOverrides) DEFINE_FIELD_U(bNeutral, CultureDataBaseObject, bNeutral) -#ifndef FEATURE_CORECLR DEFINE_FIELD_U(bWin32Installed, CultureDataBaseObject, bWin32Installed) DEFINE_FIELD_U(bFramework, CultureDataBaseObject, bFramework) -#endif #endif #ifndef FEATURE_COREFX_GLOBALIZATION DEFINE_CLASS_U(Globalization, CalendarData, CalendarDataBaseObject) @@ -1089,18 +1085,18 @@ DEFINE_FIELD_U(numberNegativePattern, NumberFormatInfo, cNegativeNumberFormat DEFINE_FIELD_U(percentPositivePattern, NumberFormatInfo, cPositivePercentFormat) DEFINE_FIELD_U(percentNegativePattern, NumberFormatInfo, cNegativePercentFormat) DEFINE_FIELD_U(percentDecimalDigits, NumberFormatInfo, cPercentDecimals) -#ifndef FEATURE_CORECLR +#ifndef FEATURE_COREFX_GLOBALIZATION DEFINE_FIELD_U(digitSubstitution, NumberFormatInfo, iDigitSubstitution) -#endif // !FEATURE_CORECLR +#endif DEFINE_FIELD_U(isReadOnly, NumberFormatInfo, bIsReadOnly) #ifndef FEATURE_COREFX_GLOBALIZATION DEFINE_FIELD_U(m_useUserOverride, NumberFormatInfo, bUseUserOverride) #endif DEFINE_FIELD_U(m_isInvariant, NumberFormatInfo, bIsInvariant) -#ifndef FEATURE_CORECLR +#ifndef FEATURE_COREFX_GLOBALIZATION DEFINE_FIELD_U(validForParseAsNumber, NumberFormatInfo, bvalidForParseAsNumber) DEFINE_FIELD_U(validForParseAsCurrency,NumberFormatInfo, bvalidForParseAsCurrency) -#endif // !FEATURE_CORECLR +#endif // Defined as element type alias // DEFINE_CLASS(OBJECT, System, Object) diff --git a/src/vm/object.h b/src/vm/object.h index 1722c16..37560cf 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -1863,10 +1863,10 @@ private: STRINGREF m_nonSortName; // name w/o sort info (de-DE for de-DE_phoneb) STRINGREF m_sortName; // Sort only name (de-DE_phoneb, en-us for fj-fj (w/us sort) CULTUREINFOBASEREF m_parent; -#if !FEATURE_CORECLR +#ifndef FEATURE_COREFX_GLOBALIZATION INT32 iDataItem; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) INT32 iCultureID; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) -#endif // !FEATURE_CORECLR +#endif // !FEATURE_COREFX_GLOBALIZATION #ifdef FEATURE_LEAK_CULTURE_INFO INT32 m_createdDomainID; #endif // FEATURE_LEAK_CULTURE_INFO @@ -1968,8 +1968,7 @@ public: /* 0x160 */ STRINGREF sCompareInfo ; // Compare info name (including sorting key) to use if custom /* 0x168 */ STRINGREF sScripts ; // Typical Scripts for this locale (latn;cyrl; etc) -#if !defined(FEATURE_CORECLR) - // desktop only fields - these are ordered correctly + // these are ordered correctly /* ????? */ STRINGREF sAbbrevLang ; // abbreviated language name (Windows Language Name) ex: ENU /* ????? */ STRINGREF sAbbrevCountry ; // abbreviated country name (RegionInfo) (Windows Region Name) ex: USA /* ????? */ STRINGREF sISO639Language2 ; // 3 char ISO 639 lang name 2 ex: eng @@ -1977,7 +1976,6 @@ public: /* ????? */ STRINGREF sConsoleFallbackName ; // The culture name for the console fallback UI culture /* ????? */ STRINGREF sKeyboardsToInstall ; // Keyboard installation string. /* ????? */ STRINGREF fontSignature ; // Font signature (16 WORDS) -#endif // Unused for now: /* ????? */ INT32 iCountry ; // (user can override) country code (RegionInfo) /* 0x170 */ INT32 iGeoId ; // GeoId @@ -1996,21 +1994,18 @@ public: /* 0x1a0 */ INT32 iFirstWeekOfYear ; // (user can override) first week of year (gregorian really) /* ????? */ INT32 iReadingLayout; // Reading Layout Data (0-3) -#if !defined(FEATURE_CORECLR) - // desktop only fields - these are ordered correctly + + // these are ordered correctly /* ????? */ INT32 iDefaultAnsiCodePage ; // default ansi code page ID (ACP) /* ????? */ INT32 iDefaultOemCodePage ; // default oem code page ID (OCP or OEM) /* ????? */ INT32 iDefaultMacCodePage ; // default macintosh code page /* ????? */ INT32 iDefaultEbcdicCodePage ; // default EBCDIC code page /* ????? */ INT32 iLanguage ; // locale ID (0409) - NO sort information /* ????? */ INT32 iInputLanguageHandle ; // input language handle -#endif /* 0x1a4 */ CLR_BOOL bUseOverrides ; // use user overrides? /* 0x1a5 */ CLR_BOOL bNeutral ; // Flags for the culture (ie: neutral or not right now) -#if !defined(FEATURE_CORECLR) /* ????? */ CLR_BOOL bWin32Installed ; // Flags indicate if the culture is Win32 installed /* ????? */ CLR_BOOL bFramework ; // Flags for indicate if the culture is one of Whidbey cultures -#endif }; // class CultureDataBaseObject @@ -4568,19 +4563,19 @@ public: INT32 cPositivePercentFormat; // positivePercentFormat INT32 cNegativePercentFormat; // negativePercentFormat INT32 cPercentDecimals; // percentDecimalDigits -#ifndef FEATURE_CORECLR +#ifndef FEATURE_COREFX_GLOBALIZATION INT32 iDigitSubstitution; // digitSubstitution -#endif +#endif CLR_BOOL bIsReadOnly; // Is this NumberFormatInfo ReadOnly? #ifndef FEATURE_COREFX_GLOBALIZATION CLR_BOOL bUseUserOverride; // Flag to use user override. Only used from managed code. #endif CLR_BOOL bIsInvariant; // Is this the NumberFormatInfo for the Invariant Culture? -#ifndef FEATURE_CORECLR +#ifndef FEATURE_COREFX_GLOBALIZATION CLR_BOOL bvalidForParseAsNumber; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) CLR_BOOL bvalidForParseAsCurrency; // NEVER USED, DO NOT USE THIS! (Serialized in Whidbey/Everett) -#endif // !FEATURE_CORECLR +#endif }; typedef NumberFormatInfo * NUMFMTREF; -- 2.7.4