mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Add conditional check (#8736)
* resolve windows compile error * add conditional for undef new --------- Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
This commit is contained in:
@@ -770,13 +770,15 @@ void FixedLengthArrayTest() {
|
||||
// set memory chunk of size ArrayStruct to 1's
|
||||
std::memset(static_cast<void*>(non_zero_memory), 1, arr_size);
|
||||
// after placement-new it should be all 0's
|
||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \
|
||||
defined(_MSC_VER) && defined(_DEBUG)
|
||||
#undef new
|
||||
#endif
|
||||
MyGame::Example::ArrayStruct* ap =
|
||||
new (non_zero_memory) MyGame::Example::ArrayStruct;
|
||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||
#define new DEBUG_NEW
|
||||
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \
|
||||
defined(_MSC_VER) && defined(_DEBUG)
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
(void)ap;
|
||||
for (size_t i = 0; i < arr_size; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user