소스 검색

Use std placement new on non MSVC compilers (#7009)

Fix build break on macOS due to clash between std placement new and custom one.
Lukas Kurz 1 년 전
부모
커밋
36becec433
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      lib/Common/Memory/Allocator.h

+ 11 - 0
lib/Common/Memory/Allocator.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.
 //-------------------------------------------------------------------------------------------------------
 #pragma once
@@ -448,6 +449,8 @@ void AssertValue(void * mem, T value, uint byteCount)
 #define NO_EXPORT(x) x
 #endif
 
+#if defined(_MSC_VER) && !defined(__clang__)
+
 // For the debugger extension, we don't need the placement news
 #ifndef __PLACEMENT_NEW_INLINE
 #define __PLACEMENT_NEW_INLINE
@@ -473,6 +476,14 @@ void * previousAllocation               // Previously allocated memory
 
 #endif
 
+#else
+
+// Use std inline placement new instead of custom
+// See PR #7009
+#include <new>
+
+#endif
+
 //----------------------------------------
 // throwing operator new overrides
 //----------------------------------------