diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2022-04-02 15:18:07 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2022-04-02 15:18:07 -0400 |
commit | 6ba284f22feeedb394697d112cf1da80c77bb5a4 (patch) | |
tree | 8135304088aa151a907c4ba07f946688ff4ba51c /celt/float_cast.h | |
parent | 2654707e86cc94413998976d179b2ab4a2aa3114 (diff) | |
download | opus-6ba284f22feeedb394697d112cf1da80c77bb5a4.tar.gz |
Fix lrint/lrintf detection
Prevents using lrint/lrintf when compiling with -std=c90 even though the
functions are in libm. This was causing tests to fail, likely due to
incorrect prototypes.
Diffstat (limited to 'celt/float_cast.h')
-rw-r--r-- | celt/float_cast.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/celt/float_cast.h b/celt/float_cast.h index 9d34976e..8915a5fd 100644 --- a/celt/float_cast.h +++ b/celt/float_cast.h @@ -99,7 +99,7 @@ static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_s return intgr ; } -#elif defined(HAVE_LRINTF) +#elif defined(HAVE_LRINTF) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* These defines enable functionality introduced with the 1999 ISO C ** standard. They must be defined before the inclusion of math.h to @@ -117,7 +117,7 @@ static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_s #include <math.h> #define float2int(x) lrintf(x) -#elif (defined(HAVE_LRINT)) +#elif defined(HAVE_LRINT) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 |