#include <deal.II/base/config.h>
-// It's necessary to include winsock2.h before thread_local_storage.h,
-// because Intel implementation of TBB includes winsock.h,
-// and we'll get a conflict between winsock.h and winsock2.h otherwise.
-#ifdef DEAL_II_MSVC
-# include <winsock2.h>
-#endif
-
#include <deal.II/base/exceptions.h>
#include <deal.II/base/mpi.h>
#include <deal.II/base/point.h>
# include <cstdlib>
#endif
+// It's necessary to include winsock2.h before thread_local_storage.h,
+// because Intel implementation of TBB includes winsock.h,
+// and we'll get a conflict between winsock.h and winsock2.h otherwise.
+#ifdef DEAL_II_MSVC
+# include <winsock2.h>
+#endif
+
+#ifndef DEAL_II_MSVC
+// On Unix-type systems, we use posix-memalign:
+# include <mm_malloc.h>
+#endif
+
+
DEAL_II_NAMESPACE_OPEN
#else
// Windows does not appear to have posix_memalign. just use the
// regular malloc in that case
- *memptr = malloc(size);
+ *memptr = std::malloc(size);
(void)alignment;
AssertThrow(*memptr != nullptr, ExcOutOfMemory(size));
#endif