Skip to content
Snippets Groups Projects
Commit 6ba284f2 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

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.
parent 2654707e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment