]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a necessary header include. 18234/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Mar 2025 14:59:26 +0000 (08:59 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 12 Mar 2025 14:25:32 +0000 (08:25 -0600)
source/base/utilities.cc

index e41b50f622bfff0753e2bba642102adbcc1001ae..b72e1c71cf5dae34a1d22a29072a6f5f286eb583 100644 (file)
 
 #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
 
@@ -1091,7 +1097,7 @@ namespace Utilities
 #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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.