$extrastylesheet
slepc_macro.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_SLEPC_MACRO_H
00021 #define LIBMESH_SLEPC_MACRO_H
00022 
00023 // C++ includes
00024 
00025 // Local includes
00026 
00031 #ifdef LIBMESH_HAVE_SLEPC
00032 
00033 # include <slepcversion.h>
00034 
00035 // A convenient macro for comparing SLEPc versions.
00036 // Returns 1 if the current SLEPc version is < major.minor.subminor
00037 // and zero otherwise.
00038 #define SLEPC_VERSION_LESS_THAN(major,minor,subminor)                   \
00039   ((SLEPC_VERSION_MAJOR < (major) ||                                    \
00040     (SLEPC_VERSION_MAJOR == (major) && (SLEPC_VERSION_MINOR < (minor) || \
00041                                         (SLEPC_VERSION_MINOR == (minor) && \
00042                                          SLEPC_VERSION_SUBMINOR < (subminor))))) ? 1 : 0)
00043 
00044 // Make up for missing extern "C" in old SLEPc versions
00045 #if !defined(LIBMESH_USE_COMPLEX_NUMBERS) && SLEPC_VERSION_LESS_THAN(3,0,0)
00046 #  define EXTERN_C_FOR_SLEPC_BEGIN extern "C" {
00047 #  define EXTERN_C_FOR_SLEPC_END }
00048 #else
00049 #  define EXTERN_C_FOR_SLEPC_BEGIN
00050 #  define EXTERN_C_FOR_SLEPC_END
00051 #endif
00052 
00053 #if SLEPC_VERSION_RELEASE && SLEPC_VERSION_LESS_THAN(3,1,1)
00054 #  define LibMeshEPSDestroy(x)         EPSDestroy(*(x))
00055 #else
00056 #  define LibMeshEPSDestroy(x)         EPSDestroy(x)
00057 #endif
00058 
00059 #endif // #if LIBMESH_HAVE_SLEPC
00060 #endif // LIBMESH_SLEPC_MACRO_H