Skip to content

Commit

Permalink
Prevent defining _GUARD_CHECK_ICALL twice (chakra-core#6974)
Browse files Browse the repository at this point in the history
* Prevent defining `_GUARD_CHECK_ICALL` twice
Newer versions of MVC define _GUARD_CHECK_ICALL after CC defines it
  • Loading branch information
ShortDevelopment authored Apr 16, 2024
1 parent d1cc2b4 commit 2f15d4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/Runtime/Base/ThreadContextInfo.cpp
Original file line number Diff line number Diff line change
@@ -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.
//-------------------------------------------------------------------------------------------------------

Expand All @@ -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() :
Expand Down
5 changes: 1 addition & 4 deletions lib/Runtime/Base/ThreadContextInfo.h
Original file line number Diff line number Diff line change
@@ -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.
//-------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -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

0 comments on commit 2f15d4e

Please # to comment.