diff --git a/ide/vs2017/mimalloc.vcxproj b/ide/vs2017/mimalloc.vcxproj index 1e39f917..1ff1af9c 100644 --- a/ide/vs2017/mimalloc.vcxproj +++ b/ide/vs2017/mimalloc.vcxproj @@ -110,7 +110,7 @@ true ../../include _CRT_SECURE_NO_WARNINGS;MI_DEBUG=3;%(PreprocessorDefinitions); - CompileAsCpp + CompileAsC false stdcpp17 @@ -129,7 +129,7 @@ true ../../include _CRT_SECURE_NO_WARNINGS;MI_DEBUG=3;%(PreprocessorDefinitions); - CompileAsCpp + CompileAsC false stdcpp17 @@ -161,7 +161,7 @@ false false Default - CompileAsCpp + CompileAsC true @@ -188,7 +188,7 @@ false false Default - CompileAsCpp + CompileAsC true diff --git a/ide/vs2019/mimalloc-test-stress.vcxproj b/ide/vs2019/mimalloc-test-stress.vcxproj index ef7ab357..afbb6666 100644 --- a/ide/vs2019/mimalloc-test-stress.vcxproj +++ b/ide/vs2019/mimalloc-test-stress.vcxproj @@ -149,8 +149,8 @@ - - {abb5eae7-b3e6-432e-b636-333449892ea6} + + {abb5eae7-b3e6-432e-b636-333449892ea7} diff --git a/src/heap.c b/src/heap.c index 76a90911..b1079e14 100644 --- a/src/heap.c +++ b/src/heap.c @@ -11,6 +11,9 @@ terms of the MIT license. A copy of the license can be found in the file #include // memset, memcpy +#if defined(_MSC_VER) && (_MSC_VER < 1920) +#pragma warning(disable:4204) // non-constant aggregate initializer +#endif /* ----------------------------------------------------------- Helpers @@ -550,9 +553,6 @@ static bool mi_heap_area_visitor(const mi_heap_t* heap, const mi_heap_area_ex_t* // Visit all blocks in a heap bool mi_heap_visit_blocks(const mi_heap_t* heap, bool visit_blocks, mi_block_visit_fun* visitor, void* arg) { - mi_visit_blocks_args_t args = { 0 }; - args.visit_blocks = visit_blocks; - args.visitor = visitor; - args.arg = arg; + mi_visit_blocks_args_t args = { visit_blocks, visitor, arg }; return mi_heap_visit_areas(heap, &mi_heap_area_visitor, &args); } diff --git a/src/stats.c b/src/stats.c index b484efb1..2fe914c8 100644 --- a/src/stats.c +++ b/src/stats.c @@ -11,6 +11,9 @@ terms of the MIT license. A copy of the license can be found in the file #include // fputs, stderr #include // memset +#if defined(_MSC_VER) && (_MSC_VER < 1920) +#pragma warning(disable:4204) // non-constant aggregate initializer +#endif /* ----------------------------------------------------------- Statistics operations