microsoft/wil

Compilation error with Microsoft.Windows.ImplementationLibrary.1.0.240122.1

Closed this issue · 2 comments

include of

#include "wil/com.h"
result to

1>....\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\include\wil\result.h(419,38): error C2061: syntax error: identifier 'pNewRaw'
1>....\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\include\wil\result.h(419,51): error C2143: syntax error: missing ';' before '{'
1>....\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\include\wil\result.h(419,60): error C2143: syntax error: missing ';' before '}'
1>C....\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\include\wil\result.h(425,25): error C3536: 'pNew': cannot be used before it is initialized
1>....\packages\Microsoft.Windows.ImplementationLibrary.1.0.240122.1\include\wil\result.h(426,32): error C2664: 'PVOID _InterlockedCompareExchangePointer(volatile PVOID *,PVOID,PVOID)': cannot convert argument 2 from 'int' to 'PVOID'

                if (auto pNewRaw = details::ProcessHeapAlloc(0, sizeof(Node)))
                {
                    auto pNew = new (pNewRaw) Node{threadId}; // here - what does this code means?

                    Node* pFirst;

What C++ standard version are you using? We require at lest C++17

I see. It was C++ 14 in my case - want to bring updates for some long live project - now problem with my particular case resolved, thank you for answer.