diff --git a/stl/inc/xiosbase b/stl/inc/xiosbase index 363a51c9575..a1b5ff24ae3 100644 --- a/stl/inc/xiosbase +++ b/stl/inc/xiosbase @@ -22,7 +22,6 @@ _STD_BEGIN template class _Iosb { // define templatized bitmask/enumerated types, instantiate on demand public: - enum _Dummy_enum { _Dummy_enum_val = 1 }; // don't ask, TRANSITION, ABI enum _Fmtflags { // constants for formatting options _Fmtmask = 0xffff, _Fmtzero = 0 @@ -46,10 +45,9 @@ public: static constexpr int hexfloat = 0x3000; // TRANSITION, ABI, GH-3296 static constexpr int boolalpha = 0x4000; - static constexpr int _Stdio = 0x8000; - static constexpr int adjustfield = 0x01C0; // left | right | internal - static constexpr int basefield = 0x0E00; // dec | oct | hex - static constexpr int floatfield = 0x3000; // scientific | fixed + static constexpr int adjustfield = left | right | internal; + static constexpr int basefield = dec | oct | hex; + static constexpr int floatfield = scientific | fixed; enum _Iostate { // constants for stream states _Statmask = 0x17 @@ -60,10 +58,6 @@ public: static constexpr int failbit = 0x2; static constexpr int badbit = 0x4; - enum _Openmode { // constants for file opening options - _Openmask = 0xff - }; - static constexpr int in = 0x01; static constexpr int out = 0x02; static constexpr int ate = 0x04; @@ -76,21 +70,18 @@ public: static constexpr int noreplace = _Noreplace; #endif - enum _Seekdir { // constants for file positioning options - _Seekbeg, - _Seekcur, - _Seekend - }; - - static constexpr int beg = _Seekbeg; - static constexpr int cur = _Seekcur; - static constexpr int end = _Seekend; - - enum { // TRANSITION, ABI - _Openprot = _SH_DENYNO - }; + static constexpr int beg = 0; + static constexpr int cur = 1; + static constexpr int end = 2; static constexpr int _Default_open_prot = _SH_DENYNO; // constant for default file opening protection + + // TRANSITION, ABI: These enums don't appear in the STL DLL's export surface, but MaxMPDCompat + // in the MSVC-internal build detects that they appear in the CompatibilityData baseline. + enum _Dummy_enum { _Dummy_enum_val = 1 }; + enum _Openmode { _Openmask = 0xff }; + enum _Seekdir { _Seekbeg, _Seekcur, _Seekend }; + enum { _Openprot = _SH_DENYNO }; }; _EXPORT_STD extern "C++" class _CRTIMP2_PURE_IMPORT ios_base : public _Iosb { // base class for ios diff --git a/stl/inc/xlocale b/stl/inc/xlocale index d169357747f..0f3738223c6 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -23,34 +23,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN template -class _Locbase { // define templatized category constants, instantiate on demand -public: - _PGLOBAL static const int collate = _M_COLLATE; - _PGLOBAL static const int ctype = _M_CTYPE; - _PGLOBAL static const int monetary = _M_MONETARY; - _PGLOBAL static const int numeric = _M_NUMERIC; - _PGLOBAL static const int time = _M_TIME; - _PGLOBAL static const int messages = _M_MESSAGES; - _PGLOBAL static const int all = _M_ALL; - _PGLOBAL static const int none = 0; -}; - -template -const int _Locbase<_Dummy>::collate; -template -const int _Locbase<_Dummy>::ctype; -template -const int _Locbase<_Dummy>::monetary; -template -const int _Locbase<_Dummy>::numeric; -template -const int _Locbase<_Dummy>::time; -template -const int _Locbase<_Dummy>::messages; -template -const int _Locbase<_Dummy>::all; -template -const int _Locbase<_Dummy>::none; +class _Locbase {}; // TRANSITION, ABI, affects sizeof(locale) _EXPORT_STD template class collate; @@ -90,6 +63,15 @@ _EXPORT_STD extern "C++" class locale : public _Locbase, public _Crt_new_de public: using category = int; + static constexpr category collate = _M_COLLATE; + static constexpr category ctype = _M_CTYPE; + static constexpr category monetary = _M_MONETARY; + static constexpr category numeric = _M_NUMERIC; + static constexpr category time = _M_TIME; + static constexpr category messages = _M_MESSAGES; + static constexpr category all = _M_ALL; + static constexpr category none = 0; + class _CRTIMP2_PURE_IMPORT id { // identifier stamp, unique for each distinct kind of facet public: __CLR_OR_THIS_CALL id(size_t _Val = 0) : _Id(_Val) {}