From ea26b00c067b5a8beef6f98b18551876e7985a16 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 13 Mar 2017 00:36:01 +0100 Subject: [PATCH] Fix CREAL,CIMAG macros for PGI --- common.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index b4acada32..c9cc2f0f2 100644 --- a/common.h +++ b/common.h @@ -556,8 +556,13 @@ static void __inline blas_lock(volatile BLASULONG *address){ #endif #if defined(C_PGI) || defined(C_SUN) -#define CREAL(X) (*((FLOAT *)&X + 0)) -#define CIMAG(X) (*((FLOAT *)&X + 1)) + #if defined(__STDC_IEC_559_COMPLEX__) + #define CREAL(X) creal(X) + #define CIMAG(X) cimag(X) + #else + #define CREAL(X) (*((FLOAT *)&X + 0)) + #define CIMAG(X) (*((FLOAT *)&X + 1)) + #endif #else #ifdef OPENBLAS_COMPLEX_STRUCT #define CREAL(Z) ((Z).real)