2010-04-17  Kai Tietz  <kai.tietz@onevision.com>

        * malloc.h, stdlib.h: Improve declaration of _aligned_malloc
        and _aligned_free for not collide by xmmintrin.h/mm_malloc.h
        provided by gcc.



git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@2243 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h
index 96ff25c..808f60e 100644
--- a/mingw-w64-headers/crt/stdlib.h
+++ b/mingw-w64-headers/crt/stdlib.h
@@ -408,6 +408,7 @@
   void *__cdecl realloc(void *_Memory,size_t _NewSize);
   _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
 /* Make sure that X86intrin.h doesn't produce here collisions.  */
+#if (!defined (_XMMINTRIN_H_INCLUDED) && !defined (_MM_MALLOC_H_INCLUDED) || defined(_aligned_malloc)
 #pragma push_macro("_aligned_free")
 #pragma push_macro("_aligned_malloc")
 #undef _aligned_free
@@ -416,7 +417,7 @@
   _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment);
 #pragma pop_macro("_aligned_free")
 #pragma pop_macro("_aligned_malloc")
-
+#endif
   _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
   _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
   _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);