EASTL
EASTL copied to clipboard
EASTL failed to build due to error C3861: '_InterlockedExchange64_INLINE': identifier not found with MSVC on windows.
Environment: Windows Server 2016 + VS2019 + EASTL master branch latest https://github.com/electronicarts/EASTL/commit/d9965101482ad13a900c50dab0cac268cd90346b source code.
EASTL failed to build due to error C3861: '_InterlockedExchange64_INLINE': identifier not found with MSVC on windows. It can be first reproduced on latest master revision. Could you help have a look about this issue? Thanks in advance!
Steps to reproduce the behavior:
- git clone https://github.com/electronicarts/EASTL F:\EASTL\src
- Open a VS 2019 x86 command prompt as admin and browse to F:\EASTL\src
- git submodule update --init
- mkdir build_x86 && pushd build_x86
- cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DEASTL_BUILD_TESTS:BOOL=ON -DEASTL_BUILD_BENCHMARK:BOOL=OFF ..
- msbuild /m /p:Platform=Win32 /p:Configuration=Release EASTL.sln /t:Rebuild test.log
Actual result: 11>F:\EASTL\src\test\packages\EAThread\include\eathread/internal/eathread_atomic_standalone_msvc.h(201,107): error C3861: '_InterlockedExchange64_INLINE': identifier not found (compiling source file F:\EASTL\src\test\packages\EAThread\source\eathread_futex.cpp) [F:\EASTL\src\build_x86\test\packages\EAThread\EAThread.vcxproj] 11>F:\EASTL\src\test\packages\EAThread\include\eathread/internal/eathread_atomic_standalone_msvc.h(201,107): error C3861: '_InterlockedExchange64_INLINE': identifier not found (compiling source file F:\EASTL\src\test\packages\EAThread\source\eathread_rwmutex.cpp) [F:\EASTL\src\build_x86\test\packages\EAThread\EAThread.vcxproj] 11>F:\EASTL\src\test\packages\EAThread\include\eathread/internal/eathread_atomic_standalone_msvc.h(201,107): error C3861: '_InterlockedExchange64_INLINE': identifier not found (compiling source file F:\EASTL\src\test\packages\EAThread\source\eathread_pool.cpp) [F:\EASTL\src\build_x86\test\packages\EAThread\EAThread.vcxproj] 11>F:\EASTL\src\test\packages\EAThread\include\eathread/internal/eathread_atomic_standalone_msvc.h(201,107): error C3861: '_InterlockedExchange64_INLINE': identifier not found (compiling source file F:\EASTL\src\test\packages\EAThread\source\eathread.cpp) [F:\EASTL\src\build_x86\test\packages\EAThread\EAThread.vcxproj] 11>F:\EASTL\src\test\packages\EAThread\include\eathread/internal/eathread_atomic_standalone_msvc.h(201,107): error C3861: '_InterlockedExchange64_INLINE': identifier not found (compiling source file F:\EASTL\src\test\packages\EAThread\source\eathread_thread.cpp) [F:\EASTL\src\build_x86\test\packages\EAThread\EAThread.vcxproj]
Any updates?
Hi all,
This issue still can be reproduced on latest commit of EASTL master branch. And We tried to investigate it and found that some macros in ..\test\packages\EAThread\include\eathread\internal\eathread_atomic_standalone_msvc.h are not defined. This file is in the submodule test/packages/EAThread. The undefined macros are as follows:
_InterlockedExchange64_INLINE _InterlockedExchangeAdd64_INLINE _InterlockedAnd64_INLINE _InterlockedOr64_INLINE _InterlockedXor64_INLINE
We tried to redefine them as below: #if defined(EA_PROCESSOR_X86) extern "C" int64_t _InterlockedExchange64_INLINE(int64_t volatile* Target, int64_t Value); extern "C" int64_t _InterlockedExchangeAdd64_INLINE(int64_t volatile* Addend, int64_t Value); extern "C" int64_t _InterlockedAnd64_INLINE(int64_t volatile* Target, int64_t Value); extern "C" int64_t _InterlockedOr64_INLINE(int64_t volatile* Target, int64_t Value); extern "C" int64_t _InterlockedXor64_INLINE(int64_t volatile* Target, int64_t Value);
#define _InterlockedExchange64 _InterlockedExchange64_INLINE
#define _InterlockedExchangeAdd64 _InterlockedExchangeAdd64_INLINE
#define _InterlockedAnd64 _InterlockedAnd64_INLINE
#define _InterlockedOr64 _InterlockedOr64_INLINE
#define _InterlockedXor64 _InterlockedXor64_INLINE
#endif
And re-build it pass. Do you think this fix method is possible? If it is possible, can you fix this problem on the master branch? Currently we will apply a patch until this problem is fixed on the master branch.
Thanks, Lin