malloc.h doesn't declare _aligned_malloc/_aligned_free if windows.h is included first.
See attached example:
$ x86_64-w64-mingw32-gcc -Wall -o aligned_malloc aligned_malloc.c
aligned_malloc.c: In function ‘main’:
aligned_malloc.c:5:2: warning: implicit declaration of function ‘_aligned_malloc’ [-Wimplicit-function-declaration]
aligned_malloc.c:5:12: warning: initialization makes pointer from integer without a cast [enabled by default]
aligned_malloc.c:6:2: warning: implicit declaration of function ‘_aligned_free’ [-Wimplicit-function-declaration]
The issue seems to be related to _MM_MALLOC_H_INCLUDED being defined in intrin.h which is included indirectly by windows.h.
But I'm not sure what's the best way to fix this....
Log in to post a comment.