From 6aeefcd0f05d43d1040174d3ccc2fad340552004 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Sat, 2 Sep 2023 13:24:32 +0200 Subject: [PATCH] changed: use PETSC_NULLPTR for PETSc < 3.19 we define this to PETSC_NULL. use of PETSC_NULL causes a deprecation warning in 3.19 --- src/LinAlg/LinAlgInit.C | 2 +- src/LinAlg/PETScSupport.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LinAlg/LinAlgInit.C b/src/LinAlg/LinAlgInit.C index f6195629d..e661c474d 100644 --- a/src/LinAlg/LinAlgInit.C +++ b/src/LinAlg/LinAlgInit.C @@ -36,7 +36,7 @@ LinAlgInit::LinAlgInit (int argc, char** argv) #if defined(HAS_SLEPC) SlepcInitialize(&argc,&argv,(char*)0,PETSC_NULL); #elif defined(HAS_PETSC) - PetscInitialize(&argc,&argv,(char*)0,PETSC_NULL); + PetscInitialize(&argc,&argv,(char*)0,PETSC_NULLPTR); #endif #ifdef HAVE_MPI #ifndef HAS_PETSC diff --git a/src/LinAlg/PETScSupport.h b/src/LinAlg/PETScSupport.h index 5ebabec00..bd52fb370 100644 --- a/src/LinAlg/PETScSupport.h +++ b/src/LinAlg/PETScSupport.h @@ -41,6 +41,10 @@ #include "slepceps.h" #endif +#ifndef PETSC_NULLPTR +#define PETSC_NULLPTR PETSC_NULL +#endif + #else typedef int PetscInt; //!< To avoid compilation failures typedef double PetscReal; //!< To avoid compilation failures