From 978405aacfd54e8bf38dd6f376464eeb0dbd96ec Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 29 May 2025 07:32:11 -0600 Subject: [PATCH] Duplicate two p4est macros. --- source/distributed/p4est_wrappers.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/distributed/p4est_wrappers.cc b/source/distributed/p4est_wrappers.cc index 9f1bdb19f5..6023064260 100644 --- a/source/distributed/p4est_wrappers.cc +++ b/source/distributed/p4est_wrappers.cc @@ -17,7 +17,27 @@ #include #ifdef DEAL_II_WITH_P4EST +# include +# include # include + +// 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 and 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 -- 2.39.5