Просмотр исходного кода

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
Lukas Kurz 1 год назад
Родитель
Сommit
2f15d4e8df
2 измененных файлов с 6 добавлено и 4 удалено
  1. 5 0
      lib/Runtime/Base/ThreadContextInfo.cpp
  2. 1 4
      lib/Runtime/Base/ThreadContextInfo.h

+ 5 - 0
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() :

+ 1 - 4
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