Only include complex.h since Android 5.0

This commit is contained in:
Zhang Xianyi 2015-10-27 10:47:55 -05:00
parent 70642fe4ed
commit 63c56d3da9
1 changed files with 9 additions and 5 deletions

View File

@ -98,6 +98,10 @@ extern "C" {
#ifdef OS_ANDROID #ifdef OS_ANDROID
#define NO_SYSV_IPC #define NO_SYSV_IPC
//Android NDK only supports complex.h since Android 5.0
#if __ANDROID_API__ < 21
#define FORCE_OPENBLAS_COMPLEX_STRUCT
#endif
#endif #endif
#ifdef OS_WINDOWS #ifdef OS_WINDOWS
@ -501,8 +505,8 @@ static void __inline blas_lock(volatile BLASULONG *address){
/* C99 supports complex floating numbers natively, which GCC also offers as an /* C99 supports complex floating numbers natively, which GCC also offers as an
extension since version 3.0. If neither are available, use a compatible 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). */ structure as fallback (see Clause 6.2.5.13 of the C99 standard). */
#if (defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \ #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \
(__GNUC__ >= 3 && !defined(__cplusplus)) ) (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT)))
#define OPENBLAS_COMPLEX_C99 #define OPENBLAS_COMPLEX_C99
#ifndef __cplusplus #ifndef __cplusplus
#include <complex.h> #include <complex.h>