Function _aligned_msize() is available only in msvcr80+ and UCRT. It is not
available in msvcrt.dll system os library.
---
 mingw-w64-crt/Makefile.am           |  2 ++
 mingw-w64-crt/misc/_aligned_msize.c | 13 +++++++++++++
 mingw-w64-headers/crt/crtdbg.h      |  2 --
 mingw-w64-headers/crt/malloc.h      |  2 --
 mingw-w64-headers/crt/stdlib.h      |  2 --
 5 files changed, 15 insertions(+), 6 deletions(-)
 create mode 100644 mingw-w64-crt/misc/_aligned_msize.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index d3bc865baaf9..5f7805c94739 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -327,6 +327,7 @@ src_msvcrt=\
   misc/__iswcsymf.c \
   misc/__sys_errlist.c \
   misc/__sys_nerr.c \
+  misc/_aligned_msize.c \
   misc/_aligned_offset_recalloc.c \
   misc/_aligned_recalloc.c \
   misc/_configthreadlocale.c \
@@ -833,6 +834,7 @@ src_pre_msvcr80=\
   misc/__iswcsymf.c \
   misc/__sys_errlist.c \
   misc/__sys_nerr.c \
+  misc/_aligned_msize.c \
   misc/_aligned_offset_recalloc.c \
   misc/_aligned_recalloc.c \
   misc/_configthreadlocale.c \
diff --git a/mingw-w64-crt/misc/_aligned_msize.c 
b/mingw-w64-crt/misc/_aligned_msize.c
new file mode 100644
index 000000000000..14f25836d517
--- /dev/null
+++ b/mingw-w64-crt/misc/_aligned_msize.c
@@ -0,0 +1,13 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <malloc.h>
+
+size_t __cdecl _aligned_msize(void *memory, size_t alignment, size_t offset)
+{
+  return __mingw_aligned_msize(memory, alignment, offset);
+}
+size_t (__cdecl *__MINGW_IMP_SYMBOL(_aligned_msize))(void *, size_t, size_t) = 
_aligned_msize;
diff --git a/mingw-w64-headers/crt/crtdbg.h b/mingw-w64-headers/crt/crtdbg.h
index 2da0cdbe72a5..37014c4fb291 100644
--- a/mingw-w64-headers/crt/crtdbg.h
+++ b/mingw-w64-headers/crt/crtdbg.h
@@ -164,9 +164,7 @@ extern "C" {
 #define _recalloc_dbg(p,c,s,t,f,l) _recalloc(p,c,s)
 #define _aligned_recalloc_dbg(p,c,s,a,f,l) _aligned_realloc(p,c,s,a)
 #define _aligned_offset_recalloc_dbg(p,c,s,a,o,f,l) 
_aligned_offset_recalloc(p,c,s,a,o)
-#if __MSVCRT_VERSION__ >= 0x800
 #define _aligned_msize_dbg(p,a,o) _aligned_msize(p,a,o)
-#endif
 
 #define _malloca_dbg(s,t,f,l) _malloca(s)
 #define _freea_dbg(p,t) _freea(p)
diff --git a/mingw-w64-headers/crt/malloc.h b/mingw-w64-headers/crt/malloc.h
index 52918782bf8c..48ae0db90430 100644
--- a/mingw-w64-headers/crt/malloc.h
+++ b/mingw-w64-headers/crt/malloc.h
@@ -105,9 +105,7 @@ extern "C" {
   _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
   _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t 
_Size,size_t _Alignment);
   _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t 
_Count,size_t _Size,size_t _Alignment,size_t _Offset);
-# if __MSVCRT_VERSION__ >= 0x800
   _CRTIMP size_t __cdecl _aligned_msize(void *_Memory,size_t _Alignment,size_t 
_Offset);
-# endif
 
 #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
 #pragma pop_macro("calloc")
diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h
index 998eb4362cac..482971357cfe 100644
--- a/mingw-w64-headers/crt/stdlib.h
+++ b/mingw-w64-headers/crt/stdlib.h
@@ -461,9 +461,7 @@ float __cdecl __MINGW_NOTHROW strtof(const char * 
__restrict__ _Str,char ** __re
   _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
   _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t 
_Size,size_t _Alignment);
   _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t 
_Count,size_t _Size,size_t _Alignment,size_t _Offset);
-# if __MSVCRT_VERSION__ >= 0x800
   _CRTIMP size_t __cdecl _aligned_msize(void *_Memory,size_t _Alignment,size_t 
_Offset);
-# endif
 
 #if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)
 #pragma pop_macro("calloc")
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to