Skip to content

Commit a735988

Browse files
committed
Update for VS2019 Preview 2 which introduced another ICE related to modules
1 parent e7e97e1 commit a735988

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

Common.FastVector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class fast_vector<T, 0, ShouldInitializeElements>
550550
{
551551
// Try to just reallocate the existing memory block.
552552

553-
void* memory = realloc(GetMemoryBlock(data_), newByteSize);
553+
void* memory = std::realloc(GetMemoryBlock(data_), newByteSize);
554554
if (memory == nullptr && newByteSize > 0)
555555
{
556556
throw std::bad_alloc();

Common.FastVector.ixx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
// For whatever inane reason, VS complains here but not in other files.
66
// error C7577: a global module fragment can only appear at the start of a translation unit
7-
// #if USE_CPP_MODULES
7+
#if USE_CPP_MODULES
88
module;
9-
// #endif
9+
#endif
1010

1111
#include "precomp.h"
1212

Common.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
//----------------------------------------------------------------------------
44
#pragma once
55

6+
#ifndef USE_CPP_MODULES
67
#ifdef __cpp_modules
78
#define USE_CPP_MODULES 1
8-
#elif !defined(USE_CPP_MODULES)
9+
#else
910
#define USE_CPP_MODULES 0
1011
#endif
12+
#endif
1113

1214

1315
#if USE_CPP_MODULES // Is there no __cpp_modules feature test macro?

FileHelpers.ixx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
// History: 2013-10-04 Dwayne Robinson - Created
55
//----------------------------------------------------------------------------
66

7+
#if USE_CPP_MODULES
78
module;
9+
#endif
810

911
#include "precomp.h"
1012

TextLayoutSampler.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
6262
<UndefinePreprocessorDefinitions>
6363
</UndefinePreprocessorDefinitions>
64-
<PrecompiledHeader>Use</PrecompiledHeader>
64+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
6565
<PrecompiledHeaderFile>precomp.h</PrecompiledHeaderFile>
6666
<AdditionalOptions>/ifcSearchDir $(IntDir)</AdditionalOptions>
6767
<AdditionalIncludeDirectories>

0 commit comments

Comments
 (0)