From 69064726ac89733e23939491e8e9515774608c8c Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Mon, 9 Feb 2026 15:38:08 +0000 Subject: [PATCH] COMP: Address compile issue with mingw Use _aligned_malloc with mingw compiler. [ 58%] Building C object .../Utilities/gdcmext/mec_mr3_io.c.obj C:/ITK/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmext/mec_mr3_io.c: In function 'aligned_alloc_impl': C:/ITK/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmext/mec_mr3_io.c:320:15: error: implicit declaration of function 'posix_memalign' [-Wimplicit-function-declaration] 320 | int error = posix_memalign(&allocPtr, alignment, size); --- Utilities/gdcmext/mec_mr3_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Utilities/gdcmext/mec_mr3_io.c b/Utilities/gdcmext/mec_mr3_io.c index f08b859f1..659d16f04 100644 --- a/Utilities/gdcmext/mec_mr3_io.c +++ b/Utilities/gdcmext/mec_mr3_io.c @@ -312,7 +312,7 @@ static bool read_info(struct app *self, const uint8_t group, } static void *aligned_alloc_impl(size_t alignment, size_t size) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) return _aligned_malloc(size, alignment); #else // return aligned_alloc(alignment, size); @@ -957,7 +957,7 @@ bool mec_mr3_print(const void *input, const size_t len) { good = good && read_group(self, group, nitems, &info, &data); } // release memory: -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) _aligned_free(data.buffer); #else free(data.buffer);