From: Wolfgang Bangerth Date: Thu, 29 May 2025 13:32:11 +0000 (-0600) Subject: Duplicate two p4est macros. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18516%2Fhead;p=dealii.git Duplicate two p4est macros. --- 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