From 64ad8b9809e3768981d540d6f674a4642b86bf8d Mon Sep 17 00:00:00 2001 From: Zaheer Chothia Date: Fri, 1 Feb 2013 09:24:44 +0100 Subject: [PATCH] Refs #193. Don't use C99 complex numbers when building C++ code. --- common.h | 3 ++- openblas_config_template.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index 4403af13d..a822b7182 100644 --- a/common.h +++ b/common.h @@ -390,7 +390,8 @@ typedef int blasint; /* C99 supports complex floating numbers natively, which GCC also offers as an extension since version 3.0. If neither are available, use a compatible structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ -#if defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || __GNUC__ >= 3 +#if (defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || + (__GNUC__ >= 3 && !defined(__cplusplus))) #define OPENBLAS_COMPLEX_C99 typedef float _Complex openblas_complex_float; typedef double _Complex openblas_complex_double; diff --git a/openblas_config_template.h b/openblas_config_template.h index a2b05696f..0d1186819 100644 --- a/openblas_config_template.h +++ b/openblas_config_template.h @@ -48,7 +48,8 @@ typedef int blasint; /* C99 supports complex floating numbers natively, which GCC also offers as an extension since version 3.0. If neither are available, use a compatible structure as fallback (see Clause 6.2.5.13 of the C99 standard). */ -#if defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || __GNUC__ >= 3 +#if (defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || + (__GNUC__ >= 3 && !defined(__cplusplus))) #define OPENBLAS_COMPLEX_C99 #include typedef float _Complex openblas_complex_float;