Skip to content

Commit dc0191a

Browse files
committed
Disable cpp modules again because VS2019 broke them again with ICEs. Fix some other build issues.
1 parent 5e678bb commit dc0191a

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

Attributes.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ interface IAttributeSource
312312
//{
313313
// return HRESULT_FROM_WIN32(ERROR_UNMAPPED_SUBSTITUTION_STRING);
314314
//}
315-
values.reset(byteValues.reinterpret_as<T>());
315+
auto a = byteValues.reinterpret_as<T>();
316+
values.reset(a);
316317
return S_OK;
317318
}
318319

@@ -329,7 +330,8 @@ interface IAttributeSource
329330

330331
if (SUCCEEDED(GetValueData(id, OUT actualType, OUT byteValues)))
331332
{
332-
values.reset(byteValues.reinterpret_as<T>());
333+
auto a = byteValues.reinterpret_as<T>();
334+
values.reset(a);
333335
}
334336
// // todo::: restore once you figure out enums! || !Attribute::AreCompatibleTypes(desiredType, actualType))
335337
//if (!Attribute::AreCompatibleTypes(desiredType, actualType))

Attributes.ixx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ char16_t const* Attribute::GetPredefinedValue(uint32_t valueIndex, GetPredefined
6464
}
6565
else
6666
{
67-
auto& newBuffer = std::to_wstring(predefinedValue.integerValue);
67+
auto newBuffer = std::to_wstring(predefinedValue.integerValue);
6868
auto& recastBuffer = reinterpret_cast<std::u16string&>(newBuffer);
6969
buffer = recastBuffer;
7070
}
@@ -149,7 +149,7 @@ HRESULT Attribute::ParseString(
149149
{
150150
HRESULT hr = HRESULT_FROM_WIN32(ERROR_UNMAPPED_SUBSTITUTION_STRING);
151151

152-
if (stringValue == '\0')
152+
if (stringValue == nullptr)
153153
return hr;
154154

155155
static_assert(Attribute::TypeTotal == 13, "Update this switch statement.");
@@ -253,7 +253,7 @@ HRESULT Attribute::MapValueToName(_Out_ uint32_t enumValue, _Out_ std::u16string
253253

254254
// Otherwise look for a numeric value, confirming that numeric value is
255255
// actually in the enumeration set.
256-
auto& newString = std::to_wstring(enumValue);
256+
auto newString = std::to_wstring(enumValue);
257257
auto& recastString = reinterpret_cast<std::u16string&>(newString);
258258
std::swap(stringValue, recastString);
259259

Common.FastVector.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#pragma warning(push)
77
#pragma warning(disable:4127) // Conditional expression is constant. VS can't tell that certain compound conditionals of template parameters aren't always constant when the tempalate parameter is true.
88

9-
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
9+
// Disable for Visual Studio 2019
10+
#if 0 // defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
1011
// For std::uninitialized_copy and std::uninitialized_move.
1112
#define FASTVECTOR_MAKE_UNCHECKED stdext::make_unchecked_array_iterator
1213
#else

DrawableObject.ixx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,11 @@ HRESULT DrawableObjectGdiTextOut::Draw(
15571557

15581558
if (!glyphs.empty() || !attributeSource.GetString(DrawableObjectAttributeGlyphs).empty())
15591559
{
1560-
text.reset(glyphs.reinterpret_as<char16_t const>());
1560+
// Assign to a temporary to work around bogus error.
1561+
// message : A non-const reference may only be bound to an lvalue
1562+
// There's utterly no reason why you shouldn't be able to pass a temporary as mutable in the language. -_-
1563+
auto a = glyphs.reinterpret_as<char16_t const>();
1564+
text.reset(a);
15611565
textOutFlags |= ETO_GLYPH_INDEX;
15621566
// todo::: Pass glyph advances if non-empty. ETO_PDY
15631567
}
@@ -2089,7 +2093,8 @@ HRESULT CachedDWriteGlyphRun::Update(
20892093
// leaving the others as zeroes.
20902094
if (glyphOffsetFloats.size() >= glyphs.size() * 2U)
20912095
{
2092-
glyphOffsets.reset(glyphOffsetFloats.reinterpret_as<DWRITE_GLYPH_OFFSET const>());
2096+
auto a = glyphOffsetFloats.reinterpret_as<DWRITE_GLYPH_OFFSET const>();
2097+
glyphOffsets.reset(a);
20932098
}
20942099
else
20952100
{
@@ -3370,7 +3375,8 @@ HRESULT DrawableObjectGdiPlusDrawDriverString::Draw(
33703375
if (glyphs.empty() && attributeSource.GetString(DrawableObjectAttributeGlyphs).empty())
33713376
{
33723377
drawDriverStringFlags |= Gdiplus::DriverStringOptionsCmapLookup;
3373-
glyphs.reset(text.reinterpret_as<uint16_t const>());
3378+
auto a = text.reinterpret_as<uint16_t const>();
3379+
glyphs.reset(a);
33743380
// todo::: Convert and pass glyph advances if non-empty.
33753381
}
33763382

MainWindow.ixx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ INT_PTR MainWindow::InitializeMainDialog()
481481
// but they also ignore the Edit_SetCueBannerText call, meaning we can't
482482
// just call GetCueBannerText in the subclassed function. So store it as
483483
// a window property instead.
484-
SetProp(attributeValuesEdit, L"CueBannerText", L"<no attributes selected>");
484+
SetProp(attributeValuesEdit, L"CueBannerText", const_cast<wchar_t*>(L"<no attributes selected>"));
485485

486486
auto attributesEdit = GetWindowFromId(hwnd_, IdcAttributesFilterEdit);
487487
Edit_SetCueBannerText(attributesEdit, L"<type attribute filter here>");
@@ -1100,7 +1100,7 @@ void MainWindow::InitializeDefaultDrawableObjects()
11001100
////////////////////
11011101
// Initialize with typical APIs.
11021102

1103-
char16_t* const functionNames[] = {
1103+
char16_t const* const functionNames[] = {
11041104
u"D2D DrawTextLayout",
11051105
u"IDWriteBitmapRenderTarget IDWriteTextLayout",
11061106
u"User32 DrawText",

TextLayoutSampler.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</UndefinePreprocessorDefinitions>
6464
<PrecompiledHeader>Use</PrecompiledHeader>
6565
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
66-
<AdditionalOptions>/module:search $(IntDir)</AdditionalOptions>
66+
<AdditionalOptions>/ifcSearchDir $(IntDir)</AdditionalOptions>
6767
<AdditionalIncludeDirectories>
6868
</AdditionalIncludeDirectories>
6969
<DisableSpecificWarnings>
@@ -73,7 +73,7 @@
7373
</ItemDefinitionGroup>
7474
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7575
<ClCompile>
76-
<PreprocessorDefinitions>_DEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
76+
<PreprocessorDefinitions>_DEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
7777
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
7878
<Optimization>Disabled</Optimization>
7979
<UndefinePreprocessorDefinitions>
@@ -89,7 +89,7 @@
8989
</ItemDefinitionGroup>
9090
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
9191
<ClCompile>
92-
<PreprocessorDefinitions>_DEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
92+
<PreprocessorDefinitions>_DEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9393
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
9494
<Optimization>Disabled</Optimization>
9595
<UndefinePreprocessorDefinitions>
@@ -103,7 +103,7 @@
103103
</ItemDefinitionGroup>
104104
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
105105
<ClCompile>
106-
<PreprocessorDefinitions>NDEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
106+
<PreprocessorDefinitions>NDEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
107107
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
108108
<UndefinePreprocessorDefinitions>
109109
</UndefinePreprocessorDefinitions>
@@ -125,7 +125,7 @@
125125
</ItemDefinitionGroup>
126126
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
127127
<ClCompile>
128-
<PreprocessorDefinitions>NDEBUG;USE_CPP_MODULES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
128+
<PreprocessorDefinitions>NDEBUG;USE_CPP_MODULES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
129129
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
130130
<UndefinePreprocessorDefinitions>
131131
</UndefinePreprocessorDefinitions>

0 commit comments

Comments
 (0)