Skip to content

Commit 24a6090

Browse files
blowekampmalaterre
authored andcommitted
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);
1 parent 912c541 commit 24a6090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Utilities/gdcmext/mec_mr3_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static bool read_info(struct app *self, const uint8_t group,
312312
}
313313

314314
static void *aligned_alloc_impl(size_t alignment, size_t size) {
315-
#ifdef _MSC_VER
315+
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
316316
return _aligned_malloc(size, alignment);
317317
#else
318318
// return aligned_alloc(alignment, size);
@@ -957,7 +957,7 @@ bool mec_mr3_print(const void *input, const size_t len) {
957957
good = good && read_group(self, group, nitems, &info, &data);
958958
}
959959
// release memory:
960-
#ifdef _MSC_VER
960+
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
961961
_aligned_free(data.buffer);
962962
#else
963963
free(data.buffer);

0 commit comments

Comments
 (0)