From 828a79ac783001f7c4d56bd06ef221f31f32f2ba Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sat, 19 Sep 2009 19:45:58 -0400 Subject: [PATCH] allow to override EIGEN_RESTRICT, to satisfy a smart ass blogger who claims that eigen2 owes all its performance to nonstandard restrict keyword. well, this can also improve portability in case some compiler doesn't have __restrict. --- Eigen/src/Core/util/Macros.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index ec8337e33..4b62891d9 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -221,7 +221,12 @@ using Eigen::ei_cos; #error Please tell me what is the equivalent of __attribute__((aligned(16))) for your compiler #endif -#define EIGEN_RESTRICT __restrict +#ifdef EIGEN_DONT_USE_RESTRICT_KEYWORD + #define EIGEN_RESTRICT +#endif +#ifndef EIGEN_RESTRICT + #define EIGEN_RESTRICT __restrict +#endif #ifndef EIGEN_STACK_ALLOCATION_LIMIT #define EIGEN_STACK_ALLOCATION_LIMIT 1000000