From b075a3dfcf5aaa72c086d7896ab0c975f42d04c2 Mon Sep 17 00:00:00 2001 From: eschnett Date: Sat, 20 Aug 2011 00:30:29 +0000 Subject: Make more C++ compilers understand the signbit function Several C++ compilers cannot handle std::signbit; use a work-around instead. Correct a namespace problem when using the same identifier Vectors_SGN for different precisions (real*4 and real*8). Correct kifpos implementation incorrectly on several architectures. git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@29 105869f7-3296-0410-a4ea-f4349344b45a --- src/vectors-4-default.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vectors-4-default.h') diff --git a/src/vectors-4-default.h b/src/vectors-4-default.h index 76bdc7d..3e5cd70 100644 --- a/src/vectors-4-default.h +++ b/src/vectors-4-default.h @@ -85,9 +85,9 @@ #define k4sqrt(x) (sqrtf(x)) #ifdef __cplusplus -# define Vectors_SGN(x) std::signbit(x) +# define k4sgn(x) ({ using namespace std; signbit(x); }) #else -# define Vectors_SGN(x) signbit(x) +# define k4sgn(x) (signbit(x)) #endif -#define k4ifpos(x,y,z) (Vectors_SGN(x)?(z):(y)) +#define k4ifpos(x,y,z) (k4sgn(x)?(z):(y)) -- cgit v1.2.3