Use macros instead of inline functions to replace the following missing C99
functions: exp2, exp2f, log2, log2f. Should fix compilation in systems where these functions are defined in math.h but not implemented. Originally committed as revision 21231 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									a4be782cbd
								
							
						
					
					
						commit
						06cb7a1c8f
					
				@ -264,17 +264,13 @@ if ((y) < (x)) {\
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if !HAVE_EXP2
 | 
			
		||||
static av_always_inline av_const double exp2(double x)
 | 
			
		||||
{
 | 
			
		||||
    return exp(x * 0.693147180559945);
 | 
			
		||||
}
 | 
			
		||||
#undef exp2
 | 
			
		||||
#define exp2(x) exp((x) * 0.693147180559945)
 | 
			
		||||
#endif /* HAVE_EXP2 */
 | 
			
		||||
 | 
			
		||||
#if !HAVE_EXP2F
 | 
			
		||||
static av_always_inline av_const float exp2f(float x)
 | 
			
		||||
{
 | 
			
		||||
    return exp2(x);
 | 
			
		||||
}
 | 
			
		||||
#undef exp2f
 | 
			
		||||
#define exp2f(x) exp2(x)
 | 
			
		||||
#endif /* HAVE_EXP2F */
 | 
			
		||||
 | 
			
		||||
#if !HAVE_LLRINT
 | 
			
		||||
@ -285,17 +281,13 @@ static av_always_inline av_const long long llrint(double x)
 | 
			
		||||
#endif /* HAVE_LLRINT */
 | 
			
		||||
 | 
			
		||||
#if !HAVE_LOG2
 | 
			
		||||
static av_always_inline av_const double log2(double x)
 | 
			
		||||
{
 | 
			
		||||
    return log(x) * 1.44269504088896340736;
 | 
			
		||||
}
 | 
			
		||||
#undef log2
 | 
			
		||||
#define log2(x) (log(x) * 1.44269504088896340736)
 | 
			
		||||
#endif /* HAVE_LOG2 */
 | 
			
		||||
 | 
			
		||||
#if !HAVE_LOG2F
 | 
			
		||||
static av_always_inline av_const float log2f(float x)
 | 
			
		||||
{
 | 
			
		||||
    return log2(x);
 | 
			
		||||
}
 | 
			
		||||
#undef log2f
 | 
			
		||||
#define log2f(x) log2(x)
 | 
			
		||||
#endif /* HAVE_LOG2F */
 | 
			
		||||
 | 
			
		||||
#if !HAVE_LRINT
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user