Skip to content

Commit 5e82819

Browse files
committed
BUG: Fix GDCM posix_memalign undefined with mingw
Address compilation error, by switching to use _aligned_malloc.
1 parent a4eb8a5 commit 5e82819

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmext

Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmext/mec_mr3_io.c

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

140140
static void *aligned_alloc_impl(size_t alignment, size_t size) {
141-
#ifdef _MSC_VER
141+
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
142142
return _aligned_malloc(size, alignment);
143143
#else
144144
// return aligned_alloc(alignment, size);
@@ -843,7 +843,7 @@ bool mec_mr3_print(const void *input, size_t len) {
843843
good = good && read_group(self, group, nitems, &info, &data);
844844
}
845845
// release memory:
846-
#ifdef _MSC_VER
846+
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
847847
_aligned_free(data.buffer);
848848
#else
849849
free(data.buffer);

0 commit comments

Comments
 (0)