Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EASTL failed to build due to error C3861: '_InterlockedExchange64_INLINE': identifier not found with MSVC on windows. #371

Open
215020267 opened this issue Jun 8, 2020 · 2 comments

Comments

@215020267
Copy link

Environment:
Windows Server 2016 + VS2019 + EASTL master branch latest d996510 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:

  1. git clone https://github.com/electronicarts/EASTL F:\EASTL\src
  2. Open a VS 2019 x86 command prompt as admin and browse to F:\EASTL\src
  3. git submodule update --init
  4. mkdir build_x86 && pushd build_x86
  5. 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 ..
  6. 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]

@QuellaZhang
Copy link

Any updates?

@spacelg
Copy link

spacelg commented Jul 21, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants