summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>2017-03-13 00:36:01 +0100
committerGitHub <noreply@github.com>2017-03-13 00:36:01 +0100
commitea26b00c067b5a8beef6f98b18551876e7985a16 (patch)
tree9b0418b510ae498d3d2b6cb429935e3f5146481c /common.h
parent9254a701f32ea9025204b686504df6367329fd72 (diff)
downloadopenblas-ea26b00c067b5a8beef6f98b18551876e7985a16.tar.gz
openblas-ea26b00c067b5a8beef6f98b18551876e7985a16.tar.bz2
openblas-ea26b00c067b5a8beef6f98b18551876e7985a16.zip
Fix CREAL,CIMAG macros for PGI
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files 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)