From c52268c649ede35328c4927da523e5712b8e5002 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 7 Jul 2011 16:42:51 +0200 Subject: [PATCH] suppress polluting EMPTY macro defined by SuperLU --- unsupported/Eigen/SuperLUSupport | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/SuperLUSupport b/unsupported/Eigen/SuperLUSupport index a0248dfb2..532cec8ce 100644 --- a/unsupported/Eigen/SuperLUSupport +++ b/unsupported/Eigen/SuperLUSupport @@ -5,11 +5,27 @@ #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" +#ifdef EMPTY +#define EIGEN_EMPTY_WAS_ALREADY_DEFINED +#endif + typedef int int_t; #include #include #include +// slu_util.h defines a preprocessor token named EMPTY which is really polluting, +// so we remove it in favor of a SUPERLU_EMPTY token. +// If EMPTY was already, defined then we don't undef it. + +#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) +# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED +#elif defined(EMPTY) +# undef EMPTY +#endif + +#define SUPERLU_EMPTY (-1) + namespace Eigen { struct SluMatrix; } namespace Eigen { @@ -17,7 +33,7 @@ namespace Eigen { /** \ingroup Unsupported_modules * \defgroup SuperLUSupport_Module Super LU support * - * + * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. * * \code * #include