crt: Provide *_recalloc functions

They are natively available since msvcr80.dll, they are not available in
msvcrt.dll. Provide compatibility emulation into all import libraries where
they are not available.

Compatibility emulation needs to use _msize() or _aligned_msize() functions
to figure out the previous size and properly clear the expanded memory as
*calloc functions require.

Memory allocated by these mingw-w64 emulation functions can be normally
released by the appropriate CRT free() or _aligned_free() function.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 files changed