]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Duplicate two p4est macros. 18516/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 29 May 2025 13:32:11 +0000 (07:32 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 29 May 2025 19:31:47 +0000 (13:31 -0600)
source/distributed/p4est_wrappers.cc

index 9f1bdb19f5f20826ad5980c9da2bff348c5d8fc8..60230642604b13cbc30cf25c212ac20e71e64254 100644 (file)
 #include <deal.II/distributed/tria.h>
 
 #ifdef DEAL_II_WITH_P4EST
+#  include <p4est.h>
+#  include <p8est.h>
 #  include <sc_containers.h>
+
+// Below, we will use the P4EST_QUADRANT_INIT and P8EST_QUADRANT_INIT
+// function-like macros. If we are building the library based on
+// header files, we get these from the <p4est.h> and <p8est.h> header
+// inclusions. But if we build a C++20 module, we only import
+// declarations, not preprocessor macros. As a consequence, let us
+// duplicate these macros here, hoping that at some point, the p4est
+// library folks add regular functions that can do the job.
+#  ifndef P4EST_QUADRANT_INIT
+#    define P4EST_QUADRANT_INIT(q) \
+      ((void)std::memset((q), -1, sizeof(p4est_quadrant_t)))
+#  endif
+
+#  ifndef P8EST_QUADRANT_INIT
+#    define P8EST_QUADRANT_INIT(q) \
+      ((void)std::memset((q), -1, sizeof(p8est_quadrant_t)))
+#  endif
+
 #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.