From 2f15d4e8df6f6c3e084ccc4a751e99868b6c0431 Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Tue, 16 Apr 2024 10:27:40 +0200 Subject: [PATCH] Prevent defining `_GUARD_CHECK_ICALL` twice (#6974) * Prevent defining `_GUARD_CHECK_ICALL` twice Newer versions of MVC define _GUARD_CHECK_ICALL after CC defines it --- lib/Runtime/Base/ThreadContextInfo.cpp | 5 +++++ lib/Runtime/Base/ThreadContextInfo.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Runtime/Base/ThreadContextInfo.cpp b/lib/Runtime/Base/ThreadContextInfo.cpp index b23f0f7d672..1dddc70eeea 100644 --- a/lib/Runtime/Base/ThreadContextInfo.cpp +++ b/lib/Runtime/Base/ThreadContextInfo.cpp @@ -1,5 +1,6 @@ //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. +// Copyright (c) ChakraCore Project Contributors. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- @@ -21,6 +22,10 @@ # else extern "C" void __fastcall _guard_check_icall(_In_ uintptr_t _Target); # endif + +# ifndef _GUARD_CHECK_ICALL +# define _GUARD_CHECK_ICALL _guard_check_icall +# endif #endif ThreadContextInfo::ThreadContextInfo() : diff --git a/lib/Runtime/Base/ThreadContextInfo.h b/lib/Runtime/Base/ThreadContextInfo.h index e901ce33873..e3889bd4f1d 100644 --- a/lib/Runtime/Base/ThreadContextInfo.h +++ b/lib/Runtime/Base/ThreadContextInfo.h @@ -1,5 +1,6 @@ //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. +// Copyright (c) ChakraCore Project Contributors. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- @@ -178,7 +179,3 @@ uintptr_t ShiftAddr(const ThreadContextInfo*const context, T* address) } uintptr_t ShiftAddr(const ThreadContextInfo*const context, uintptr_t address); - -#ifndef _GUARD_CHECK_ICALL -#define _GUARD_CHECK_ICALL _guard_check_icall -#endif